QuantumFlow supports several different quantum operations that act upon either pure or mixed states (or both). The four main types are Gate, which represents the action of an operator (typically unitary) on a state; Channel, which represents the action of a superoperator on a mixed state (used for mixed quantum-classical dynamics); Kraus, which represents a Channel as a collection of operators; and Circuit, which is a list of other operations that act in sequence. Circuits can contain any instance of the abstract quantum operation superclass, Operation, including other circuits.
Quantum operations are immutable, and transformations of these operations return new copies.
The main types of Operation’s are Gate, UnitaryGate, StdGate, Channel, Circuit, DAGCircuit, and Pauli.
An operation on a quantum state. An element of a quantum circuit.
Abstract Base Class for Gate, Circuit, and other quantum operations.
qubits – The qubits that this Operation acts upon.
params – Optional keyword parameters used to create this gate
Return the Hermitian conjugate of this quantum operation.
For unitary Gates (and Circuits composed of the same) the Hermitian conjugate returns the inverse Gate (or Circuit)
ValueError – If this operation does not support Hermitian conjugate
Convert this quantum operation to a channel (if possible).
ValueError – If this operation cannot be converted to a Channel
Convert this quantum operation to a gate (if possible).
ValueError – If this operation cannot be converted to a Gate
The names of the parameters for this operation (For operations with a fixed number of float parameters)
Is this a multi-qubit operation that is known to be invariant under permutations of qubits?
The number of qubits, for operations with a fixed number of qubits
Decompose this operation into smaller or more standard subunits. If cannot be decomposed, returns self.
Returns: An iteration of operations.
Return a a named parameters of this Operation as a float.
name – The name of the parameter (should be in cls.cv_args)
subs – Symbolic substitutions to resolve symbolic Variables
KeyError – If unrecognized parameter name
ValueError – If Variable cannot be converted to float
Return the name of this Operation
Return a copy of this Operation with new qubits
Return a a named parameters of this Operation.
KeyError – If unrecognized parameter name
Return all of the parameters of this Operation
Convert qubits to index positions.
ValueError – If argument qubits are not found in operation’s qubits
Return the total number of qubits
Return the total number of qubits
Resolve symbolic parameters
Relabel qubits and return copy of this Operation
For parameterized operations, return appropriate special cases for particular parameters. Else return the original Operation.
e.g. Rx(0.0, 0).specialize() -> I(0)
Returns the tensor representation of this operation (if possible)
Returns the diagonal of the tensor representation of this operation (if possible)