# 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 of an object. add Calculates the element-wise sum between numbers, np.ndarrays, Tensors, Pwcs, or Stfs. adjoint Returns the element-wise adjoint of the last two dimensions of an object. anchored_difference_bounded_variables Creates a sequence of variables with an anchored difference bound. angle Returns the element-wise argument of an object. arccos Returns the element-wise arccosine of an object. arcsin Returns the element-wise arcsine of an object. arctan Returns the element-wise arctangent of an object. complex_pwc_signal Creates a complex piecewise-constant signal from moduli and phases. complex_value Creates element-wise complex values from real numbers, np.ndarrays, Tensors, Pwcs, or Stfs, that is, the real and imaginary parts. concatenate Concatenates a list of tensors along a specified dimension. conjugate Returns the element-wise complex conjugate of an object. constant_pwc Creates a piecewise-constant (PWC) function of time that is constant over a specified duration. 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 Create a constant sampleable tensor-valued function of time. 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 of an object. cosh Returns the element-wise hyperbolic cosine of an object. cumulative_sum Calculates the cumulative sum of a tensor along a specified dimension. density_matrix_evolution_pwc Calculates the state evolution of an open system described by the GKS–Lindblad master equation. discretize_stf Creates a piecewise-constant function by discretizing a sampleable function. estimated_krylov_subspace_dimension_arnoldi This node will be removed in the future. estimated_krylov_subspace_dimension_lanczos Calculates an appropriate Krylov subspace dimension ($$k$$) to use in the Lanczos integrator while keeping the total error in the evolution below a given error tolerance. exp Returns the element-wise exponential of an object. floordiv Calculates the element-wise rounded-down division between numbers, np.ndarrays, Tensors, Pwcs, or Stfs. gaussian_convolution_kernel Creates a convolution kernel representing a normalized Gaussian. gaussian_integral_function This node will be removed in the future. 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. identity_stf Returns an Stf representing the identity function, f(t) = t. imag Returns the element-wise imaginary part of an object. infidelity_pwc Creates the total infidelity of the given piecewise-constant system. infidelity_stf Creates the total infidelity of a given system with a sampleable Hamiltonian. kron Calculates the Kronecker product between np.ndarrays, Tensors, Pwcs, or Stfs. log Returns the element-wise natural logarithm of an object. matmul Calculates the matrix multiplication between np.ndarrays, Tensors, Pwcs, or Stfs. 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. multiply Calculates the element-wise product between numbers, np.ndarrays, Tensors, Pwcs, or Stfs. negative Returns the element-wise numerical negative value of an object. optimization_variable Creates optimization variables, which can be bounded, semi-bounded, or unbounded. pow Calculates the element-wise power between numbers, np.ndarrays, Tensors, Pwcs, or Stfs. pwc Creates a piecewise-constant function of time. 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. random_choices Creates random samples from the data that you provide. random_colored_noise_stf_signal Samples the one-sided power spectral density (PSD) of a random noise process in the time domain and returns the resultant noise trajectories as an Stf. random_normal Creates a sample of normally distributed random numbers. random_uniform Creates a sample of uniformly distributed random numbers. real Returns the element-wise real part of an object. real_fourier_pwc_signal Creates a piecewise-constant signal constructed from Fourier components. real_fourier_stf_signal Creates a real sampleable signal constructed from Fourier components. repeat Repeats elements of a tensor. reverse Reverses a tensor along some specified dimensions. sample_pwc Samples a Pwc at the given times. sample_stf Samples an Stf at the given times. sin Returns the element-wise sine of an object. sinc_convolution_kernel Creates a convolution kernel representing the sinc function. sinc_integral_function This node will be removed in the future. sinh Returns the element-wise hyperbolic sine of an object. 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 of an object. 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_operator_hermitian_part Creates the Hermitian part of an operator-valued sampleable function. stf_sum Creates the sum of multiple sampleable functions. subtract Calculates the element-wise difference between numbers, np.ndarrays, Tensors, Pwcs, or Stfs. 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 of an object. tanh Returns the element-wise hyperbolic tangent of an object. target Creates information about the target for system time evolution. tensor_pwc This node will be removed in the future. 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 element-wise trace of an object. transpose Returns the input tensor with its dimensions reordered. truediv Calculates the element-wise division between numbers, np.ndarrays, Tensors, Pwcs, or Stfs.

Types

 ConvolutionKernel A kernel to be used in a convolution. Pwc A piecewise-constant tensor-valued function of time (or batch of such functions). 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.