# Nodes

Source: https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/nodes

<span id="optimization-variables"></span>

## Optimization variables

When performing optimizations, you can use these operations to create the optimizable variables that can be tuned by the optimizer in order to minimize your cost function.

|||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
| [anchored_difference_bounded_variables](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/anchored_difference_bounded_variables.md#boulderopal.graph.Graph.anchored_difference_bounded_variables)   | Create a sequence of optimizable variables with an anchored difference bound.                   |
| [complex_optimizable_pwc_signal](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/complex_optimizable_pwc_signal.md#boulderopal.graph.Graph.complex_optimizable_pwc_signal)                        | Create a complex optimizable piecewise-constant signal.                                         |
| [optimizable_scalar](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/optimizable_scalar.md#boulderopal.graph.Graph.optimizable_scalar)                                                            | Create an optimizable scalar Tensor, which can be bounded, semi-bounded, or unbounded.          |
| [optimization_variable](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/optimization_variable.md#boulderopal.graph.Graph.optimization_variable)                                                   | Create a 1D Tensor of optimization variables, which can be bounded, semi-bounded, or unbounded. |
| [real_fourier_pwc_signal](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/real_fourier_pwc_signal.md#boulderopal.graph.Graph.real_fourier_pwc_signal)                                             | Create a piecewise-constant signal constructed from Fourier components.                         |
| [real_fourier_stf_signal](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/real_fourier_stf_signal.md#boulderopal.graph.Graph.real_fourier_stf_signal)                                             | Create a real sampleable signal constructed from Fourier components.                            |
| [real_optimizable_pwc_signal](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/real_optimizable_pwc_signal.md#boulderopal.graph.Graph.real_optimizable_pwc_signal)                                 | Create a real optimizable piecewise-constant signal.                                            |

<span id="piecewise-constant-tensor-functions-pwcs"></span>

## Piecewise-constant tensor functions (PWCs)

You can use these operations to create piecewise-constant functions either to represent control signals or system Hamiltonians.

|||
|---------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| [complex_pwc_signal](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/complex_pwc_signal.md#boulderopal.graph.Graph.complex_pwc_signal)                | Create a complex piecewise-constant signal from moduli and phases.                       |
| [constant_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/constant_pwc.md#boulderopal.graph.Graph.constant_pwc)                                  | Create a piecewise-constant function of time that is constant over a specified duration. |
| [constant_pwc_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/constant_pwc_operator.md#boulderopal.graph.Graph.constant_pwc_operator)       | Create a constant piecewise-constant operator over a specified duration.                 |
| [pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/pwc.md#boulderopal.graph.Graph.pwc)                                                             | Create a piecewise-constant function of time.                                            |
| [pwc_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/pwc_operator.md#boulderopal.graph.Graph.pwc_operator)                                  | Create a constant operator multiplied by a piecewise-constant signal.                    |
| [pwc_signal](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/pwc_signal.md#boulderopal.graph.Graph.pwc_signal)                                        | Create a piecewise-constant signal (scalar-valued function of time).                     |
| [pwc_sum](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/pwc_sum.md#boulderopal.graph.Graph.pwc_sum)                                                 | Create the sum of multiple piecewise-constant terms.                                     |
| [real_fourier_pwc_signal](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/real_fourier_pwc_signal.md#boulderopal.graph.Graph.real_fourier_pwc_signal) | Create a piecewise-constant signal constructed from Fourier components.                  |
| [sample_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sample_pwc.md#boulderopal.graph.Graph.sample_pwc)                                        | Sample a Pwc at the given times.                                                         |
| [symmetrize_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/symmetrize_pwc.md#boulderopal.graph.Graph.symmetrize_pwc)                            | Create the symmetrization of a piecewise-constant function.                              |
| [time_concatenate_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/time_concatenate_pwc.md#boulderopal.graph.Graph.time_concatenate_pwc)          | Concatenate multiple piecewise-constant functions in the time dimension.                 |
| [time_reverse_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/time_reverse_pwc.md#boulderopal.graph.Graph.time_reverse_pwc)                      | Reverse in time a piecewise-constant function.                                           |

<span id="sampleable-tensor-functions-stfs"></span>

## Sampleable tensor functions (STFs)

You can use these functions to represent time-dependent functions in Boulder Opal.

|||
|---------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| [constant_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/constant_stf.md#boulderopal.graph.Graph.constant_stf)                                  | Create a constant sampleable tensor-valued function of time.         |
| [constant_stf_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/constant_stf_operator.md#boulderopal.graph.Graph.constant_stf_operator)       | Create a constant operator.                                          |
| [identity_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/identity_stf.md#boulderopal.graph.Graph.identity_stf)                                  | Create an Stf representing the identity function, f(t) = t.          |
| [real_fourier_stf_signal](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/real_fourier_stf_signal.md#boulderopal.graph.Graph.real_fourier_stf_signal) | Create a real sampleable signal constructed from Fourier components. |
| [sample_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sample_stf.md#boulderopal.graph.Graph.sample_stf)                                        | Sample an Stf at the given times.                                    |
| [stf_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/stf_operator.md#boulderopal.graph.Graph.stf_operator)                                  | Create a constant operator multiplied by a sampleable signal.        |
| [stf_sum](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/stf_sum.md#boulderopal.graph.Graph.stf_sum)                                                 | Create the sum of multiple sampleable functions.                     |

<span id="filtering-and-discretizing"></span>

## Filtering and discretizing

You can use these functions to filter or resample the control signals.

|||
|---------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| [convolve_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/convolve_pwc.md#boulderopal.graph.Graph.convolve_pwc)                                              | Create the convolution of a piecewise-constant function with a kernel.                     |
| [discretize_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/discretize_stf.md#boulderopal.graph.Graph.discretize_stf)                                        | Create a piecewise-constant function by discretizing a sampleable function.                |
| [filter_and_resample_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/filter_and_resample_pwc.md#boulderopal.graph.Graph.filter_and_resample_pwc)             | Filter a piecewise-constant function by convolving it with a kernel and resample it again. |
| [gaussian_convolution_kernel](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/gaussian_convolution_kernel.md#boulderopal.graph.Graph.gaussian_convolution_kernel) | Create a convolution kernel representing a normalized Gaussian.                            |
| [sinc_convolution_kernel](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sinc_convolution_kernel.md#boulderopal.graph.Graph.sinc_convolution_kernel)             | Create a convolution kernel representing the sinc function.                                |

<span id="predefined-signals"></span>

## Predefined signals

You can use these operations to create common analytical signals.

For creating analytical signals not bound to a graph see the [Signal library](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/signals.md#signal-library) module.

|||
|------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [signals.SegmentationType](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/SegmentationType.md#boulderopal.graph.signals.SegmentationType)       | An enumeration of segmentation types for piecewise-constant signals.   |
| [signals.cosine_pulse_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/cosine_pulse_pwc.md#boulderopal.graph.signals.cosine_pulse_pwc)       | Create a Pwc representing a cosine pulse.                              |
| [signals.gaussian_pulse_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/gaussian_pulse_pwc.md#boulderopal.graph.signals.gaussian_pulse_pwc) | Create a Pwc representing a Gaussian pulse.                            |
| [signals.gaussian_pulse_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/gaussian_pulse_stf.md#boulderopal.graph.signals.gaussian_pulse_stf) | Create an Stf representing a Gaussian pulse.                           |
| [signals.hann_series_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/hann_series_pwc.md#boulderopal.graph.signals.hann_series_pwc)          | Create a Pwc representing a sum of Hann window functions.              |
| [signals.hann_series_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/hann_series_stf.md#boulderopal.graph.signals.hann_series_stf)          | Create an Stf representing a sum of Hann window functions.             |
| [signals.linear_ramp_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/linear_ramp_pwc.md#boulderopal.graph.signals.linear_ramp_pwc)          | Create a Pwc representing a linear ramp.                               |
| [signals.linear_ramp_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/linear_ramp_stf.md#boulderopal.graph.signals.linear_ramp_stf)          | Create an Stf representing a linear ramp.                              |
| [signals.sech_pulse_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/sech_pulse_pwc.md#boulderopal.graph.signals.sech_pulse_pwc)             | Create a Pwc representing a hyperbolic secant pulse.                   |
| [signals.sech_pulse_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/sech_pulse_stf.md#boulderopal.graph.signals.sech_pulse_stf)             | Create an Stf representing a hyperbolic secant pulse.                  |
| [signals.sinusoid_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/sinusoid_pwc.md#boulderopal.graph.signals.sinusoid_pwc)                   | Create a Pwc representing a sinusoidal oscillation.                    |
| [signals.sinusoid_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/sinusoid_stf.md#boulderopal.graph.signals.sinusoid_stf)                   | Create an Stf representing a sinusoidal oscillation.                   |
| [signals.square_pulse_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/square_pulse_pwc.md#boulderopal.graph.signals.square_pulse_pwc)       | Create a Pwc representing a square pulse.                              |
| [signals.tanh_ramp_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/tanh_ramp_pwc.md#boulderopal.graph.signals.tanh_ramp_pwc)                | Create a Pwc representing a hyperbolic tangent ramp.                   |
| [signals.tanh_ramp_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/signals/tanh_ramp_stf.md#boulderopal.graph.signals.tanh_ramp_stf)                | Create an Stf representing a hyperbolic tangent ramp.                  |

<span id="quantum-information"></span>

## Quantum information

You can use these operations to calculate common operations and metrics from quantum information theory.

|||
|------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| [annihilation_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/annihilation_operator.md#boulderopal.graph.Graph.annihilation_operator)                                  | Create an annihilation operator in the truncated Fock space.                                              |
| [coherent_state](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/coherent_state.md#boulderopal.graph.Graph.coherent_state)                                                       | Create a coherent state (or a batch of them).                                                             |
| [creation_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/creation_operator.md#boulderopal.graph.Graph.creation_operator)                                              | Create a creation operator in the truncated Fock space.                                                   |
| [density_matrix_expectation_value](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/density_matrix_expectation_value.md#boulderopal.graph.Graph.density_matrix_expectation_value) | Calculate the expectation value of an operator with respect to a density matrix.                          |
| [density_matrix_infidelity](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/density_matrix_infidelity.md#boulderopal.graph.Graph.density_matrix_infidelity)                      | Calculate the infidelity between two states represented by density matrices.                              |
| [displacement_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/displacement_operator.md#boulderopal.graph.Graph.displacement_operator)                                  | Create a displacement operator (or a batch of them).                                                      |
| [embed_operators](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/embed_operators.md#boulderopal.graph.Graph.embed_operators)                                                    | Embed an operator or set of operators into a larger Hilbert space.                                        |
| [expectation_value](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/expectation_value.md#boulderopal.graph.Graph.expectation_value)                                              | Calculate the expectation value of an operator with respect to a state.                                   |
| [fock_state](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/fock_state.md#boulderopal.graph.Graph.fock_state)                                                                   | Create a Fock state (or a batch of them).                                                                 |
| [inner_product](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/inner_product.md#boulderopal.graph.Graph.inner_product)                                                          | Calculate the inner product of two vectors.                                                               |
| [kronecker_product_list](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/kronecker_product_list.md#boulderopal.graph.Graph.kronecker_product_list)                               | Calculate the Kronecker product between a list of operators.                                              |
| [number_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/number_operator.md#boulderopal.graph.Graph.number_operator)                                                    | Create a number operator in the truncated Fock space.                                                     |
| [outer_product](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/outer_product.md#boulderopal.graph.Graph.outer_product)                                                          | Calculate the outer product of two vectors.                                                               |
| [partial_trace](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/partial_trace.md#boulderopal.graph.Graph.partial_trace)                                                          | Calculate the partial trace of a density matrix.                                                          |
| [pauli_kronecker_product](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/pauli_kronecker_product.md#boulderopal.graph.Graph.pauli_kronecker_product)                            | Place Pauli matrices into their two-dimensional subsystems of a system and returns the Kronecker product. |
| [pauli_matrix](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/pauli_matrix.md#boulderopal.graph.Graph.pauli_matrix)                                                             | Create a Pauli matrix from a label.                                                                       |
| [squeeze_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/squeeze_operator.md#boulderopal.graph.Graph.squeeze_operator)                                                 | Create a squeeze operator (or a batch of them).                                                           |
| [state_infidelity](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/state_infidelity.md#boulderopal.graph.Graph.state_infidelity)                                                 | Calculate the infidelity of two pure states.                                                              |
| [unitary_infidelity](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/unitary_infidelity.md#boulderopal.graph.Graph.unitary_infidelity)                                           | Calculate the infidelity between a target operation and the actual implemented unitary.                   |
| [wigner_transform](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/wigner_transform.md#boulderopal.graph.Graph.wigner_transform)                                                 | Transform a density matrix into a Wigner function (or a batch of them).                                   |

<span id="time-evolution"></span>

## Time evolution

You can use these operations to calculate the time evolution of your open or closed quantum system, either for simulations or optimizations.

|||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [density_matrix_evolution_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/density_matrix_evolution_pwc.md#boulderopal.graph.Graph.density_matrix_evolution_pwc)                                              | Calculate the state evolution of an open system described by the GKS–Lindblad master equation.                                                                          |
| [estimated_krylov_subspace_dimension_lanczos](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/estimated_krylov_subspace_dimension_lanczos.md#boulderopal.graph.Graph.estimated_krylov_subspace_dimension_lanczos) | Calculate 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. |
| [filter_function](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/filter_function.md#boulderopal.graph.Graph.filter_function)                                                                                     | Evaluate the filter function for a control Hamiltonian and a noise operator at the given frequency elements.                                                            |
| [frequency_domain_noise_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/frequency_domain_noise_operator.md#boulderopal.graph.Graph.frequency_domain_noise_operator)                                     | Create a control-frame noise operator in the frequency domain for a control Hamiltonian and a noise operator at the given frequencies.                                  |
| [jump_trajectory_evolution_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/jump_trajectory_evolution_pwc.md#boulderopal.graph.Graph.jump_trajectory_evolution_pwc)                                           | Calculate the state evolution of an open system described by the GKS–Lindblad master equation using a jump-based trajectory method.                                     |
| [spectral_range](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/spectral_range.md#boulderopal.graph.Graph.spectral_range)                                                                                        | Obtain the range of the eigenvalues of a Hermitian operator.                                                                                                            |
| [state_evolution_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/state_evolution_pwc.md#boulderopal.graph.Graph.state_evolution_pwc)                                                                         | Calculate the time evolution of a state generated by a piecewise-constant Hamiltonian by using the Lanczos method.                                                      |
| [steady_state](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/steady_state.md#boulderopal.graph.Graph.steady_state)                                                                                              | Find the steady state of a time-independent open quantum system.                                                                                                        |
| [time_evolution_operators_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/time_evolution_operators_pwc.md#boulderopal.graph.Graph.time_evolution_operators_pwc)                                              | Calculate the unitary time-evolution operators for a system defined by a piecewise-constant Hamiltonian.                                                                |
| [time_evolution_operators_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/time_evolution_operators_stf.md#boulderopal.graph.Graph.time_evolution_operators_stf)                                              | Calculate the time-evolution operators for a system defined by an STF Hamiltonian by using a 4th order Runge–Kutta method.                                              |

<span id="optimal-and-robust-control"></span>

## Optimal and robust control

You can use these operations, together with the operations for creating [optimization variables](#optimization-variables) to define convenient cost functions for optimal and robust control.

|||
|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| [infidelity_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/infidelity_pwc.md#boulderopal.graph.Graph.infidelity_pwc)   | Create the total infidelity of the given piecewise-constant system.          |
| [infidelity_stf](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/infidelity_stf.md#boulderopal.graph.Graph.infidelity_stf)   | Create the total infidelity of a given system with a sampleable Hamiltonian. |
| [target](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/target.md#boulderopal.graph.Graph.target)                           | Create information about the target for system time evolution.               |

<span id="large-systems"></span>

## Large systems

You can use these operations to build graphs that efficiently handle large quantum systems.

|||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [constant_sparse_pwc_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/constant_sparse_pwc_operator.md#boulderopal.graph.Graph.constant_sparse_pwc_operator)                                              | Create a constant sparse piecewise-constant operator over a specified duration.                                                                                         |
| [density_matrix_evolution_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/density_matrix_evolution_pwc.md#boulderopal.graph.Graph.density_matrix_evolution_pwc)                                              | Calculate the state evolution of an open system described by the GKS–Lindblad master equation.                                                                          |
| [estimated_krylov_subspace_dimension_lanczos](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/estimated_krylov_subspace_dimension_lanczos.md#boulderopal.graph.Graph.estimated_krylov_subspace_dimension_lanczos) | Calculate 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. |
| [jump_trajectory_evolution_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/jump_trajectory_evolution_pwc.md#boulderopal.graph.Graph.jump_trajectory_evolution_pwc)                                           | Calculate the state evolution of an open system described by the GKS–Lindblad master equation using a jump-based trajectory method.                                     |
| [sparse_pwc_hermitian_part](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sparse_pwc_hermitian_part.md#boulderopal.graph.Graph.sparse_pwc_hermitian_part)                                                       | Create the Hermitian part of a piecewise-constant operator.                                                                                                             |
| [sparse_pwc_operator](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sparse_pwc_operator.md#boulderopal.graph.Graph.sparse_pwc_operator)                                                                         | Create a sparse piecewise-constant operator (sparse-matrix-valued function of time).                                                                                    |
| [sparse_pwc_sum](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sparse_pwc_sum.md#boulderopal.graph.Graph.sparse_pwc_sum)                                                                                        | Create the sum of multiple sparse-matrix-valued piecewise-constant functions.                                                                                           |
| [spectral_range](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/spectral_range.md#boulderopal.graph.Graph.spectral_range)                                                                                        | Obtain the range of the eigenvalues of a Hermitian operator.                                                                                                            |
| [state_evolution_pwc](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/state_evolution_pwc.md#boulderopal.graph.Graph.state_evolution_pwc)                                                                         | Calculate the time evolution of a state generated by a piecewise-constant Hamiltonian by using the Lanczos method.                                                      |
| [steady_state](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/steady_state.md#boulderopal.graph.Graph.steady_state)                                                                                              | Find the steady state of a time-independent open quantum system.                                                                                                        |

<span id="molmersorensen-gates"></span>

## Mølmer–Sørensen gates

You can use these operations to efficiently model systems described by Mølmer–Sørensen interactions.

|||
|-----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ions.ms_dephasing_robust_cost](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/ions/ms_dephasing_robust_cost.md#boulderopal.graph.ions.ms_dephasing_robust_cost)   | Calculate the cost for robust optimization of a Mølmer–Sørensen gate.                                                                                              |
| [ions.ms_displacements](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/ions/ms_displacements.md#boulderopal.graph.ions.ms_displacements)                           | Calculate the displacements for each mode and ion combination where ions are described by a Mølmer–Sørensen-type interaction.                                      |
| [ions.ms_infidelity](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/ions/ms_infidelity.md#boulderopal.graph.ions.ms_infidelity)                                    | Calculate the final operational infidelity of the Mølmer–Sørensen gate.                                                                                            |
| [ions.ms_phases](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/ions/ms_phases.md#boulderopal.graph.ions.ms_phases)                                                | Calculate the relative phases for all pairs of ions described by a Mølmer–Sørensen-type interaction when single-tone individually-addressed laser beams are used.  |
| [ions.ms_phases_multitone](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/ions/ms_phases_multitone.md#boulderopal.graph.ions.ms_phases_multitone)                  | Calculate the relative phases for all pairs of ions described by a Mølmer–Sørensen-type interaction where the ions are being addressed by a multitone global beam. |

<span id="random-operations"></span>

## Random operations

You can use these operations to create random quantities, which take different values each time they are evaluated. These operations are most useful in simulations and stochastic optimizations.

|||
|---------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| [random.choices](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/random/choices.md#boulderopal.graph.random.choices)                                                    | Create random samples from the data that you provide.                                                                                                  |
| [random.colored_noise_stf_signal](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/random/colored_noise_stf_signal.md#boulderopal.graph.random.colored_noise_stf_signal) | Sample 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](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/random/normal.md#boulderopal.graph.random.normal)                                                       | Create a sample of normally distributed random numbers.                                                                                                |
| [random.uniform](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/random/uniform.md#boulderopal.graph.random.uniform)                                                    | Create a sample of uniformly distributed random numbers.                                                                                               |

<span id="manipulating-tensors"></span>

## Manipulating tensors

You can use these operations to manipulate the structures of tensors.

|||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
| [concatenate](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/concatenate.md#boulderopal.graph.Graph.concatenate)          | Concatenate a list of tensors along a specified dimension.                                                 |
| [cumulative_sum](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/cumulative_sum.md#boulderopal.graph.Graph.cumulative_sum) | Calculate the cumulative sum of a tensor along a specified dimension.                                      |
| [einsum](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/einsum.md#boulderopal.graph.Graph.einsum)                         | Perform tensor contraction via Einstein summation convention.                                              |
| [max](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/max.md#boulderopal.graph.Graph.max)                                  | Find the maximum value in a tensor along one or multiple of its axes.                                      |
| [min](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/min.md#boulderopal.graph.Graph.min)                                  | Find the minimum value in a tensor along one or multiple of its axes.                                      |
| [repeat](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/repeat.md#boulderopal.graph.Graph.repeat)                         | Repeat elements of a tensor.                                                                               |
| [reshape](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/reshape.md#boulderopal.graph.Graph.reshape)                      | Reshape a tensor into a new shape, keeping the order of its elements.                                      |
| [reverse](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/reverse.md#boulderopal.graph.Graph.reverse)                      | Reverse a tensor along some specified dimensions.                                                          |
| [sum](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sum.md#boulderopal.graph.Graph.sum)                                  | Sum the elements in a tensor (or a list of tensors with the same shape) along one or multiple of its axes. |
| [tensor](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/tensor.md#boulderopal.graph.Graph.tensor)                         | Create a real or complex Tensor with the data provided.                                                    |
| [transpose](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/transpose.md#boulderopal.graph.Graph.transpose)                | Reorder the dimensions of a tensor.                                                                        |

<span id="linear-algebra"></span>

## Linear algebra

|||
|------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| [adjoint](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/adjoint.md#boulderopal.graph.Graph.adjoint)                                                                            | Calculate the element-wise adjoint of the last two dimensions of an object.      |
| [density_matrix_expectation_value](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/density_matrix_expectation_value.md#boulderopal.graph.Graph.density_matrix_expectation_value) | Calculate the expectation value of an operator with respect to a density matrix. |
| [einsum](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/einsum.md#boulderopal.graph.Graph.einsum)                                                                               | Perform tensor contraction via Einstein summation convention.                    |
| [embed_operators](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/embed_operators.md#boulderopal.graph.Graph.embed_operators)                                                    | Embed an operator or set of operators into a larger Hilbert space.               |
| [expectation_value](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/expectation_value.md#boulderopal.graph.Graph.expectation_value)                                              | Calculate the expectation value of an operator with respect to a state.          |
| [hermitian_part](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/hermitian_part.md#boulderopal.graph.Graph.hermitian_part)                                                       | Calculate the Hermitian part of an object.                                       |
| [hessian](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/hessian.md#boulderopal.graph.Graph.hessian)                                                                            | Calculate a single Hessian matrix for all the variables.                         |
| [inner_product](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/inner_product.md#boulderopal.graph.Graph.inner_product)                                                          | Calculate the inner product of two vectors.                                      |
| [kron](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/kron.md#boulderopal.graph.Graph.kron)                                                                                     | Calculate the Kronecker product between np.ndarrays, Tensors, Pwcs, or Stfs.     |
| [kronecker_product_list](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/kronecker_product_list.md#boulderopal.graph.Graph.kronecker_product_list)                               | Calculate the Kronecker product between a list of operators.                     |
| [matmul](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/matmul.md#boulderopal.graph.Graph.matmul)                                                                               | Calculate the matrix multiplication between np.ndarrays, Tensors, Pwcs, or Stfs. |
| [outer_product](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/outer_product.md#boulderopal.graph.Graph.outer_product)                                                          | Calculate the outer product of two vectors.                                      |
| [partial_trace](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/partial_trace.md#boulderopal.graph.Graph.partial_trace)                                                          | Calculate the partial trace of a density matrix.                                 |
| [trace](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/trace.md#boulderopal.graph.Graph.trace)                                                                                  | Calculate the trace of an object.                                                |
| [transpose](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/transpose.md#boulderopal.graph.Graph.transpose)                                                                      | Reorder the dimensions of a tensor.                                              |

<span id="basic-mathematical-functions"></span>

## Basic mathematical functions

|||
|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| [abs](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/abs.md#boulderopal.graph.Graph.abs)                                  | Calculate the element-wise absolute value of an object.                                                                           |
| [add](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/add.md#boulderopal.graph.Graph.add)                                  | Calculate the element-wise sum between numbers, np.ndarrays, Tensors, Pwcs, or Stfs.                                              |
| [angle](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/angle.md#boulderopal.graph.Graph.angle)                            | Calculate the element-wise argument of an object.                                                                                 |
| [arccos](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/arccos.md#boulderopal.graph.Graph.arccos)                         | Calculate the element-wise arccosine of an object.                                                                                |
| [arcsin](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/arcsin.md#boulderopal.graph.Graph.arcsin)                         | Calculate the element-wise arcsine of an object.                                                                                  |
| [arctan](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/arctan.md#boulderopal.graph.Graph.arctan)                         | Calculate the element-wise arctangent of an object.                                                                               |
| [complex_value](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/complex_value.md#boulderopal.graph.Graph.complex_value)    | Create element-wise complex values from real numbers, np.ndarrays, Tensors, Pwcs, or Stfs, that is, the real and imaginary parts. |
| [conjugate](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/conjugate.md#boulderopal.graph.Graph.conjugate)                | Calculate the element-wise complex conjugate of an object.                                                                        |
| [cos](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/cos.md#boulderopal.graph.Graph.cos)                                  | Calculate the element-wise cosine of an object.                                                                                   |
| [cosh](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/cosh.md#boulderopal.graph.Graph.cosh)                               | Calculate the element-wise hyperbolic cosine of an object.                                                                        |
| [cumulative_sum](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/cumulative_sum.md#boulderopal.graph.Graph.cumulative_sum) | Calculate the cumulative sum of a tensor along a specified dimension.                                                             |
| [exp](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/exp.md#boulderopal.graph.Graph.exp)                                  | Calculate the element-wise exponential of an object.                                                                              |
| [floordiv](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/floordiv.md#boulderopal.graph.Graph.floordiv)                   | Calculate the element-wise rounded-down division between real numbers, np.ndarrays, Tensors, Pwcs, or Stfs.                       |
| [imag](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/imag.md#boulderopal.graph.Graph.imag)                               | Calculate the element-wise imaginary part of an object.                                                                           |
| [log](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/log.md#boulderopal.graph.Graph.log)                                  | Calculate the element-wise natural logarithm of an object.                                                                        |
| [multiply](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/multiply.md#boulderopal.graph.Graph.multiply)                   | Calculate the element-wise product between numbers, np.ndarrays, Tensors, Pwcs, or Stfs.                                          |
| [negative](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/negative.md#boulderopal.graph.Graph.negative)                   | Calculate the element-wise numerical negative value of an object.                                                                 |
| [pow](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/pow.md#boulderopal.graph.Graph.pow)                                  | Calculate the element-wise power between numbers, np.ndarrays, Tensors, Pwcs, or Stfs.                                            |
| [real](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/real.md#boulderopal.graph.Graph.real)                               | Calculate the element-wise real part of an object.                                                                                |
| [sin](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sin.md#boulderopal.graph.Graph.sin)                                  | Calculate the element-wise sine of an object.                                                                                     |
| [sinh](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sinh.md#boulderopal.graph.Graph.sinh)                               | Calculate the element-wise hyperbolic sine of an object.                                                                          |
| [sqrt](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sqrt.md#boulderopal.graph.Graph.sqrt)                               | Calculate the element-wise square root of an object.                                                                              |
| [subtract](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/subtract.md#boulderopal.graph.Graph.subtract)                   | Calculate the element-wise difference between numbers, np.ndarrays, Tensors, Pwcs, or Stfs.                                       |
| [sum](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/sum.md#boulderopal.graph.Graph.sum)                                  | Sum the elements in a tensor (or a list of tensors with the same shape) along one or multiple of its axes.                        |
| [tan](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/tan.md#boulderopal.graph.Graph.tan)                                  | Calculate the element-wise tangent of an object.                                                                                  |
| [tanh](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/tanh.md#boulderopal.graph.Graph.tanh)                               | Calculate the element-wise hyperbolic tangent of an object.                                                                       |
| [truediv](https://docs.q-ctrl.com/references/boulder-opal/boulderopal/graph/Graph/truediv.md#boulderopal.graph.Graph.truediv)                      | Calculate the element-wise division between numbers, np.ndarrays, Tensors, Pwcs, or Stfs.                                         |
