qml.ops.op_math

This module contains classes and functions for Operator arithmetic.

Constructor Functions

adjoint(fn[, lazy])

Create the adjoint of an Operator or a function that applies the adjoint of the provided function.

ctrl(op, control[, control_values, work_wires])

Create a method that applies a controlled version of the provided op.

exp(op[, coeff, num_steps, id])

Take the exponential of an Operator times a coefficient.

sum(*summands[, do_queue, id, lazy])

Construct an operator which is the sum of the given operators.

pow(base[, z, lazy, do_queue, id])

Raise an Operator to a power.

prod(*ops[, do_queue, id, lazy])

Construct an operator which represents the generalized product of the operators provided.

s_prod(scalar, operator[, lazy, do_queue, id])

Construct an operator which is the scalar product of the given scalar and operator provided.

Symbolic Classes

Adjoint([base, do_queue, id])

The Adjoint of an operator.

CompositeOp(*operands[, do_queue, id])

A base class for operators that are composed of other operators.

Controlled(base, control_wires[, …])

Symbolic operator denoting a controlled operator.

ControlledOp(base, control_wires[, …])

Operation-specific methods and properties for the Controlled class.

Evolution(generator[, param, num_steps, …])

Create an exponential operator that defines a generator, of the form \(e^{-ix\hat{G}}\)

Exp(base[, coeff, num_steps, do_queue, id])

A symbolic operator representing the exponential of a operator.

Pow([base, z, do_queue, id])

Symbolic operator denoting an operator raised to a power.

Prod(*operands[, do_queue, id])

Symbolic operator representing the product of operators.

Sum(*operands[, do_queue, id])

Symbolic operator representing the sum of operators.

SProd(scalar, base[, do_queue, id])

Arithmetic operator representing the scalar product of an operator with the given scalar.

SymbolicOp(base[, do_queue, id])

Developer-facing base class for single-operator symbolic operators.

ScalarSymbolicOp(base, scalar[, do_queue, id])

Developer-facing base class for single-operator symbolic operators that contain a scalar coefficient.

Controlled Operator Classes

ControlledQubitUnitary(U, control_wires, …)

Apply an arbitrary fixed unitary to wires with control from the control_wires.

Decompositions

ctrl_decomp_zyz(target_operation, control_wires)

Decompose the controlled version of a target single-qubit operation

ctrl_decomp_bisect(target_operation, …)

Decompose the controlled version of a target single-qubit operation