# Operations¶

class qctrl.dynamic.namespaces.OperationNamespace

Namespace for operations. Operations are used to build graphs for remote execution of complex computation.

The types in this namespace each represent the result of some remote graph computation. As a result, you cannot directly access data from the objects of these types (although where documented you can access attributes of objects, which similarly correspond to results of remote computations). Instead, you can represent complex computations by feeding the objects output from one operation as the inputs to the next, and you can fetch the final computed values of objects by requesting them as outputs from the appropriate functions.

Methods

 abs Returns the element-wise absolute value. add Adds two values element-wise. adjoint Returns the conjugate of the input tensor representing a 2D matrix with the two innermost dimensions transposed. anchored_difference_bounded_variables Creates a sequence of variables with an anchored difference bound. angle Returns the element-wise complex argument. arccos Returns the element-wise arccosine. arcsin Returns the element-wise arcsine. arctan Returns the element-wise arctangent. bounded_optimization_variable Creates bounded optimization variables. complex_pwc_signal Creates a complex piecewise-constant signal from moduli and phases. complex_value Creates a complex number from real and imaginary parts. concatenate Concatenates a list of tensors along a specified dimension. conjugate Returns the element-wise conjugate. constant_pwc_operator Creates a constant piecewise-constant operator over a specified duration. constant_sparse_pwc_operator Creates a constant sparse piecewise-constant operator over a specified duration. constant_stf_operator Creates a constant operator. convolve_pwc Creates the convolution of a piecewise-constant function with a kernel. cos Returns the element-wise cosine. cosh Returns the element-wise hyperbolic cosine. cumulative_sum Calculates the cumulative sum of a tensor along a specified dimension. discretize_stf Creates a piecewise-constant function by discretizing a sampleable function. estimated_krylov_subspace_dimension Estimates the dimension of the Krylov subspace to be used in the Lanczos integrator for a given bound on the total error in the integration. exp Returns the element-wise exponential. floordiv Divides two values and then takes the floor of the result, element-wise. gaussian_integral_function Creates a function that computes the integral of a normalized Gaussian. getattr Gets an attribute from a node value. getitem Gets an item (or items) from a node value. hessian_matrix Calculates a single Hessian matrix for all the variables. imag Returns the element-wise imaginary part. infidelity_pwc Creates the total infidelity of the given piecewise-constant system. infidelity_stf Creates the total infidelity of the given system. log Returns the element-wise natural logarithm. matmul Performs the matrix multiplication with the two innermost dimensions of two tensors. ms_dephasing_robust_cost Calculates the cost for robust optimization of a Mølmer–Sørensen gate. ms_displacements Calculates the displacements for each mode and ion combination where ions are described by a Mølmer–Sørensen-type interaction. ms_infidelity Calculates the final operational infidelity of the Mølmer–Sørensen gate. ms_phases Calculates the relative phases for all pairs of ions described by a Mølmer–Sørensen-type interaction. mul Multiplies two values element-wise. neg Returns element-wise negative value. pow Raises one value to the power of another element-wise. pwc_operator Creates a constant operator multiplied by a piecewise-constant signal. pwc_operator_hermitian_part Creates the Hermitian part of a piecewise-constant operator. pwc_signal Creates a piecewise-constant signal (scalar-valued function of time). pwc_sum Creates the sum of multiple piecewise-constant terms. real Returns the element-wise real part. real_fourier_pwc_signal Creates a piecewise-constant signal constructed from Fourier components. reverse Reverses a tensor along some specified dimensions. sin Returns the element-wise sine. sinc_integral_function Creates a function that computes the integral of the sinc function. sinh Returns the element-wise hyperbolic sine. sparse_pwc_operator Creates a sparse piecewise-constant operator (sparse-matrix-valued function of time). sparse_pwc_sum Creates the sum of multiple sparse-matrix-valued piecewise-constant functions. spectral_range Obtains the range of the eigenvalues of a Hermitian operator. sqrt Returns the element-wise square root. state_evolution_pwc Calculates the time evolution of a state generated by a piecewise-constant Hamiltonian by using the Lanczos method. stf_operator Creates a constant operator multiplied by a sampleable signal. stf_sum Creates the sum of multiple sampleable functions. sub Subtracts one value from another element-wise. sum Returns the sum of all the elements in a tensor (or a list of tensors with the same shape). symmetrize_pwc Creates the symmetrization of a piecewise-constant function. tan Returns the element-wise tangent. tanh Returns the element-wise hyperbolic tangent. target Creates information about the target for system time evolution. tensor_pwc Creates a piecewise-constant function of time. time_evolution_operators_pwc Calculates the unitary time-evolution operators for a system defined by a piecewise-constant Hamiltonian. time_evolution_operators_stf Calculates the time-evolution operators for a system defined by an STF Hamiltonian by using a 4th order Runge–Kutta method. trace Returns the sum of the diagonals of each innermost matrix of the input tensor. transpose Returns the input tensor with its dimensions reordered. truediv Divides two values element-wise. unbounded_optimization_variable Creates unbounded optimization variables.

Types

 Function A generic callable function. SparsePwc A piecewise-constant sparse-matrix-valued function of time. Stf A sampleable tensor-valued function of time (or batch of such functions). Target A target gate for an infidelity calculation. Tensor A multi-dimensional array of data. TensorPwc A piecewise-constant tensor-valued function of time (or batch of such functions).