controlled_operator¶
Define controlled operators.
The state of one or more control qubits controls whether a certain operator acts on one or more target qubits.
- class parityos.operators.controlled_operator.TargetT¶
A
TypeVarrepresenting valid target operators for aControlledOperator.alias of TypeVar(‘TargetT’, bound=
ConcreteOperator[QubitT] |RotationOperator[QubitT,HermitianOperator[QubitT]] |OperatorProduct[ConcreteOperator[QubitT] |RotationOperator[QubitT,HermitianOperator[QubitT]]])
- class parityos.operators.controlled_operator.TargetT_co¶
A covariant
TypeVarrepresenting valid target operators for aControlledOperator.alias of TypeVar(‘TargetT_co’, bound=
ConcreteOperator[QubitT] |RotationOperator[QubitT,HermitianOperator[QubitT]] |OperatorProduct[ConcreteOperator[QubitT] |RotationOperator[QubitT,HermitianOperator[QubitT]]], covariant=True)
- class parityos.operators.controlled_operator.ControlledOperator¶
Bases:
Operator[QubitT_co],HasFrozenQubits[QubitT_co],Parameterized,Generic[QubitT_co,TargetT_co],ABCAbstract base class for a controlled operator, where the state of one or more control qubits controls whether a target operator acts on one or more target qubits.
Note
Controlled operators are always symmetric under the permutation of their control qubits, so there is no
ordered_control_qubitsfield.- property target_operator: TargetT_co¶
Operator acting on target qubits depending on the state of the control qubits.
- property control_qubits: frozenset[QubitT_co]¶
Qubits that control whether the target operator is executed.
- property ordered_target_qubits: tuple[QubitT_co, ...]¶
Ordered sequence of Qubits the target operator acts on.
- decompose() Iterator[ControlledOperator[QubitT_co, ConcreteOperator[QubitT_co] | RotationOperator[QubitT_co, HermitianOperator[QubitT_co]] | OperatorProduct[ConcreteOperator[QubitT_co] | RotationOperator[QubitT_co, HermitianOperator[QubitT_co]]]] | Self]¶
Decompose a controlled tensor product (
OperatorProduct) into an iterator of controlled single operator elements of the tensor product.The returned iterator represents the (commuting) sequence of resulting controlled single operator targets.
Note
If
target_operatoris not a tensor product, this method just yieldsself.Examples
>>> # C(Z(0)X(1)) -> CZ(0) * CX(1) >>> assert list( >>> GeneralControlledOperator(Z(get_q(0)) * X(get_q(1)), get_q("c")).decompose() >>> ) == [CZ(get_q("c"), get_q(0)), CNOT(get_q("c"), get_q(1))] >>> >>> # If the target is not a tensor product, self is yielded. >>> assert list(CNOT(get_q(0), get_q(1)).decompose()) == [CNOT(get_q(0), get_q(1))]
- Yields:
Controlled single operator element of controlled tensor product
- class parityos.operators.controlled_operator.GeneralControlledOperator(control_qubits: QubitT_co | Collection[QubitT_co], target_operator: ConcreteOperator[QubitT_co] | RotationOperator[QubitT_co, HermitianOperator[QubitT_co]] | OperatorProduct[ConcreteOperator[QubitT_co] | RotationOperator[QubitT_co, HermitianOperator[QubitT_co]]])¶
Bases:
ControlledOperator[QubitT_co,ConcreteOperator[QubitT_co] |RotationOperator[QubitT_co,HermitianOperator[QubitT_co]] |OperatorProduct[ConcreteOperator[QubitT_co] |RotationOperator[QubitT_co,HermitianOperator[QubitT_co]]]],HasFrozenUnorderedQubits[QubitT_co]General controlled operator taking any target operator and turning it into a
ControlledOperatorwith an arbitrary amount of control qubits.Note
If the target operator and number of control qubits correspond to any of the concrete implementations below, an instance of the respective concrete operator class is created instead.
Examples
>>> op = GeneralControlledOperator(Z(get_q(0)), get_q(1)) >>> assert type(op).__name__ == "CZ" >>> op = GeneralControlledOperator(RX(get_q(0)), get_q(1)) >>> assert type(op).__name__ == "CRX" >>> # not a known concrete controlled operator >>> op = GeneralControlledOperator(X(get_q(0))*Y(get_q(1)), (get_q(2), get_q(3))) >>> assert type(op).__name__ == "GeneralControlledOperator"
- Raises:
ParityOSUniquenessError – If
control_qubitsand the qubits oftarget_operatoroverlap.ParityOSException – If
control_qubitsis empty.
- control_qubits: frozenset[QubitT_co]¶
The control qubits controlling whether
target_operatoris applied.
- target_operator: ConcreteOperator[QubitT_co] | RotationOperator[QubitT_co, HermitianOperator[QubitT_co]] | OperatorProduct[ConcreteOperator[QubitT_co] | RotationOperator[QubitT_co, HermitianOperator[QubitT_co]]]¶
The target operator that is controlled by the
control_qubits.
- substitute_parameters(old_to_new: Mapping[Parameter, Symbolic | complex]) Self¶
Substitute symbolic parameters with new symbolic expressions or numeric values.
- Parameters:
old_to_new – Mapping from existing parameter symbols to new values (numeric or symbolic).
- Returns:
Copy of
selfwith replaced parameters.
- parityos.operators.controlled_operator.get_concrete_controlled_from_target(controlled_type: type[ConcreteControlledOperator[Qubit, TargetT]], target_operator: TargetT, control_qubits: Collection[Qubit]) ConcreteControlledOperator[Qubit, TargetT]¶
Create a concrete controlled operator from an instance of its target type and control qubits.
Disambiguates between different types of concrete controlled operators with different
__init__signatures and calls the correct constructor based on the input.- Parameters:
controlled_type – Concrete controlled operator type to create.
target_operator – Target operator of the concrete controlled operator to create.
control_qubits – Control qubits of the concrete controlled operator to create.
- Returns:
The concrete controlled operator created from
target_operatorandcontrol_qubits.- Raises:
ParityOSNotSupportedError – If the construction of the concrete controlled operator from
target_operatorandcontrol_qubitsis not implemented.
- class parityos.operators.controlled_operator.ConcreteControlledOperator¶
Bases:
ControlledOperator[QubitT_co,TargetT_co],ConcreteOperator[QubitT_co],ABCInterface for concrete, named controlled operators, such as
CX,CZ,CRZ,CCXetc.Implementations define their target operator type and amount of qubits as class variables and only take qubits (and potentially angles) at initialization.
- target_type: ClassVar[type[TargetT_co]]¶
Type of the target operator
- property target_operator: TargetT_co¶
Concrete instance of the target operator.
- abstractmethod classmethod from_qubits(qubits: Sequence[QubitT_co]) Self¶
Return an instance of this controlled operator from an ordered sequence of
qubits, which is a concatenation of control and target qubits.Control qubits must come before target qubits. The order of control qubits doesn’t matter, while the order of target qubits might matter, depending on whether the target operator is symmetric in its qubits.
- class parityos.operators.controlled_operator.HasSingleControlQubit(control_qubit: QubitT_co)¶
Bases:
ConcreteControlledOperator[QubitT_co,TargetT_co],ABCMixin that adds a
control_qubitattribute.
- class parityos.operators.controlled_operator.HasMultiControlQubits(control_qubits: QubitT_co | Iterable[QubitT_co])¶
Bases:
ConcreteControlledOperator[QubitT_co,TargetT_co],ABCMixin that implements
control_qubitsas an attribute.
- class parityos.operators.controlled_operator.HasSingleTargetQubit(target_qubit: QubitT_co)¶
Bases:
ConcreteControlledOperator[QubitT_co,SingleQubitOperatorT_co],ABCMixin that adds a
target_qubitattribute.
- class parityos.operators.controlled_operator.HasOrderedMultiTargetQubits(ordered_target_qubits)¶
Bases:
ConcreteControlledOperator[QubitT_co,OrderedMultiQubitOperatorT_co],ABCMixin that implements
ordered_target_qubitsas an attribute.
- class parityos.operators.controlled_operator.HasUnorderedMultiTargetQubits(target_qubits)¶
Bases:
ConcreteControlledOperator[QubitT_co,UnorderedMultiQubitOperatorT_co],ABCMixin that implements
target_qubitsas an attribute.
- class parityos.operators.controlled_operator.SingleControlSingleTarget(control_qubit: QubitT_co, target_qubit: QubitT_co)¶
Bases:
HasSingleTargetQubit[QubitT_co,SingleQubitOperatorT_co],HasSingleControlQubit[QubitT_co,SingleQubitOperatorT_co],ABCInterface for controlled operators with a single control qubit and a single target qubit.
- property target_operator: SingleQubitOperatorT_co¶
Concrete instance of the target operator.
- classmethod from_qubits(qubits: Sequence[QubitT_co]) Self¶
Return an instance of this controlled operator from an ordered sequence of
qubits, which is a concatenation of control and target qubits.Control qubits must come before target qubits. The order of control qubits doesn’t matter, while the order of target qubits might matter, depending on whether the target operator is symmetric in its qubits.
- class parityos.operators.controlled_operator.MultiControlSingleTarget(control_qubits: QubitT_co | Iterable[QubitT_co], target_qubit: QubitT_co)¶
Bases:
HasSingleTargetQubit[QubitT_co,SingleQubitOperatorT_co],HasMultiControlQubits[QubitT_co,SingleQubitOperatorT_co],ABCInterface for controlled operators with multiple control qubits and a single target qubit.
- property target_operator: SingleQubitOperatorT_co¶
Concrete instance of the target operator.
- classmethod from_qubits(qubits: Sequence[QubitT_co]) Self¶
Return an instance of this controlled operator from an ordered sequence of
qubits, which is a concatenation of control and target qubits.Control qubits must come before target qubits. The order of control qubits doesn’t matter, while the order of target qubits might matter, depending on whether the target operator is symmetric in its qubits.
- class parityos.operators.controlled_operator.SingleControlOrderedMultiTarget(control_qubit: QubitT_co, ordered_target_qubits)¶
Bases:
HasOrderedMultiTargetQubits[QubitT_co,OrderedMultiQubitOperatorT_co],HasSingleControlQubit[QubitT_co,OrderedMultiQubitOperatorT_co],ABCInterface for controlled operators with a single control qubit and an ordered sequence of target qubits.
- property target_operator: OrderedMultiQubitOperatorT_co¶
Concrete instance of the target operator.
- classmethod from_qubits(qubits: Sequence[QubitT_co]) Self¶
Return an instance of this controlled operator from an ordered sequence of
qubits, which is a concatenation of control and target qubits.Control qubits must come before target qubits. The order of control qubits doesn’t matter, while the order of target qubits might matter, depending on whether the target operator is symmetric in its qubits.
- class parityos.operators.controlled_operator.SingleControlUnorderedMultiTarget(control_qubit: QubitT_co, target_qubits)¶
Bases:
HasUnorderedMultiTargetQubits[QubitT_co,UnorderedMultiQubitOperatorT_co],HasSingleControlQubit[QubitT_co,UnorderedMultiQubitOperatorT_co],ABCInterface for controlled operators with a single control qubit acting on an unordered set of target qubits.
- property target_operator: UnorderedMultiQubitOperatorT_co¶
Concrete instance of the target operator.
- classmethod from_qubits(qubits: Sequence[QubitT_co]) Self¶
Return an instance of this controlled operator from an ordered sequence of
qubits, which is a concatenation of control and target qubits.Control qubits must come before target qubits. The order of control qubits doesn’t matter, while the order of target qubits might matter, depending on whether the target operator is symmetric in its qubits.
- class parityos.operators.controlled_operator.ControlledRotation(angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
HasAngle,ConcreteControlledOperator[QubitT_co,SingleAngleRotationT_co],ABCInterface for controlled operators with a target operator that is a single-angle rotation operator (
SingleAngleRotation).- substitute_parameters(old_to_new: Mapping[Parameter, Symbolic | complex]) Self¶
Substitute symbolic parameters with new symbolic expressions or numeric values.
- Parameters:
old_to_new – Mapping from existing parameter symbols to new values (numeric or symbolic).
- Returns:
Copy of
selfwith replaced parameters.
- abstractmethod classmethod from_qubits_and_angle(qubits: Sequence[QubitT_co], angle: Symbolic | complex) Self¶
Return an instance of this controlled rotation from an ordered sequence of
qubits, which is a concatenation of control and target qubits, and an angle.Control qubits must come before target qubits. The order of control qubits doesn’t matter, while the order of target qubits might matter, depending on whether the target operator is symmetric in its qubits.
- class parityos.operators.controlled_operator.SingleControlSingleTargetRotation(control_qubit: QubitT_co, target_qubit: QubitT_co, angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
ControlledRotation[QubitT_co,SingleQubitRotationT_co],SingleControlSingleTarget[QubitT_co,SingleQubitRotationT_co],ABCInterface for controlled rotation operators with a single control and target qubit.
Examples: CRX, CRY, CRZ
- target_operator¶
- classmethod from_qubits_and_angle(qubits: Sequence[QubitT_co], angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True))) Self¶
Return an instance of this controlled rotation from an ordered sequence of
qubits, which is a concatenation of control and target qubits, and an angle.Control qubits must come before target qubits. The order of control qubits doesn’t matter, while the order of target qubits might matter, depending on whether the target operator is symmetric in its qubits.
- class parityos.operators.controlled_operator.MultiControlSingleTargetRotation(control_qubits: QubitT_co | Iterable[QubitT_co], target_qubit: QubitT_co, angle: Coefficient = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
ControlledRotation[QubitT_co,SingleQubitRotationT_co],MultiControlSingleTarget[QubitT_co,SingleQubitRotationT_co],ABCInterface for controlled rotation operators with a multiple control and a single target qubit.
Examples: CCRX, CCRY, CCRZ
- target_operator¶
- classmethod from_qubits_and_angle(qubits: Sequence[QubitT_co], angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True))) Self¶
Return an instance of this controlled rotation from an ordered sequence of
qubits, which is a concatenation of control and target qubits, and an angle.Control qubits must come before target qubits. The order of control qubits doesn’t matter, while the order of target qubits might matter, depending on whether the target operator is symmetric in its qubits.
- class parityos.operators.controlled_operator.SingleControlUnorderedMultiTargetRotation(control_qubit: QubitT_co, target_qubits, angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
ControlledRotation[QubitT_co,UnorderedMultiQubitRotationT_co],SingleControlUnorderedMultiTarget[QubitT_co,UnorderedMultiQubitRotationT_co],ABCInterface for controlled rotation operators with a single control and an unordered set of target qubits.
Examples: CRXX, CRYY, CRZZ
- target_operator¶
- classmethod from_qubits_and_angle(qubits: Sequence[QubitT_co], angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True))) Self¶
Return an instance of this controlled rotation from an ordered sequence of
qubits, which is a concatenation of control and target qubits, and an angle.Control qubits must come before target qubits. The order of control qubits doesn’t matter, while the order of target qubits might matter, depending on whether the target operator is symmetric in its qubits.
- class parityos.operators.controlled_operator.SingleControlOrderedMultiTargetRotation(control_qubit: QubitT_co, ordered_target_qubits, angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
ControlledRotation[QubitT_co,OrderedMultiQubitT_co],SingleControlOrderedMultiTarget[QubitT_co,OrderedMultiQubitT_co],ABCInterface for controlled rotation operators with a single control and an ordered sequence of target qubits.
Examples: CRXZ
- target_operator¶
- classmethod from_qubits_and_angle(qubits: Sequence[QubitT_co], angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True))) Self¶
Return an instance of this controlled rotation from an ordered sequence of
qubits, which is a concatenation of control and target qubits, and an angle.Control qubits must come before target qubits. The order of control qubits doesn’t matter, while the order of target qubits might matter, depending on whether the target operator is symmetric in its qubits.
- final class parityos.operators.controlled_operator.CX(control_qubit: QubitT_co, target_qubit: QubitT_co)¶
Bases:
SingleControlSingleTarget[QubitT_co,X[QubitT_co]],HasNoParameters,HermitianOperator[QubitT_co]Controlled
Xoperator, also known asCNOTgate.\[\mathrm{CX} = \exp\left(i \frac{\pi}{4} (I-Z) \otimes (1-X) \right).\]
- final class parityos.operators.controlled_operator.CY(control_qubit: QubitT_co, target_qubit: QubitT_co)¶
Bases:
SingleControlSingleTarget[QubitT_co,Y[QubitT_co]],HasNoParameters,HermitianOperator[QubitT_co]Controlled
Yoperator.\[\mathrm{CY} = \exp\left(i \frac{\pi}{4} (I-Z) \otimes (1-Y) \right).\]
- final class parityos.operators.controlled_operator.CZ(control_qubit: QubitT_co, target_qubit: QubitT_co)¶
Bases:
SingleControlSingleTarget[QubitT_co,Z[QubitT_co]],HasNoParameters,HermitianOperator[QubitT_co]Controlled
Zoperator.\[\mathrm{CZ} = \exp\left(i \frac{\pi}{4} (I-Z) \otimes (1-Z) \right).\]
- final class parityos.operators.controlled_operator.CCX(control_qubits: QubitT_co | Iterable[QubitT_co], target_qubit: QubitT_co)¶
Bases:
MultiControlSingleTarget[QubitT_co,X[QubitT_co]],HasNoParameters,HermitianOperator[QubitT_co]Double controlled
Xoperator, also known asToffoligate.\[\mathrm{CCX} = \exp\left(i \frac{\pi}{8} (I-Z) \otimes (I-Z) \otimes (1-X) \right).\]
- final class parityos.operators.controlled_operator.CCY(control_qubits: QubitT_co | Iterable[QubitT_co], target_qubit: QubitT_co)¶
Bases:
MultiControlSingleTarget[QubitT_co,Y[QubitT_co]],HasNoParameters,HermitianOperator[QubitT_co]Double controlled
Yoperator.\[\mathrm{CCY} = \exp\left(i \frac{\pi}{8} (I-Z) \otimes (I-Z) \otimes (1-Y) \right).\]
- final class parityos.operators.controlled_operator.CCZ(control_qubits: QubitT_co | Iterable[QubitT_co], target_qubit: QubitT_co)¶
Bases:
MultiControlSingleTarget[QubitT_co,Z[QubitT_co]],HasNoParameters,HermitianOperator[QubitT_co]Double controlled
Zoperator.\[\mathrm{CCZ} = \exp\left(i \frac{\pi}{8} (I-Z) \otimes (I-Z) \otimes (1-Z) \right).\]
- final class parityos.operators.controlled_operator.CRX(control_qubit: QubitT_co, target_qubit: QubitT_co, angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
SingleControlSingleTargetRotation[QubitT_co,RX[QubitT_co]]Controlled
RXrotation.\[\mathrm{CRX}(\theta) = \exp\left(-i \frac{\theta}{4} (I-Z) \otimes X \right).\]
- final class parityos.operators.controlled_operator.CRY(control_qubit: QubitT_co, target_qubit: QubitT_co, angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
SingleControlSingleTargetRotation[QubitT_co,RY[QubitT_co]]Controlled
RYrotation.\[\mathrm{CRY}(\theta) = \exp\left(-i \frac{\theta}{4} (I-Z) \otimes Y \right).\]
- final class parityos.operators.controlled_operator.CRZ(control_qubit: QubitT_co, target_qubit: QubitT_co, angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
SingleControlSingleTargetRotation[QubitT_co,RZ[QubitT_co]]Controlled
RZrotation.\[\mathrm{CRZ}(\theta) = \exp\left(-i \frac{\theta}{4} (I-Z) \otimes Z \right).\]
- final class parityos.operators.controlled_operator.CCRX(control_qubits: QubitT_co | Iterable[QubitT_co], target_qubit: QubitT_co, angle: Coefficient = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
MultiControlSingleTargetRotation[QubitT_co,RX[QubitT_co]]Double controlled
RXrotation.\[\mathrm{CCRX}(\theta) = \exp\left(-i \frac{\theta}{8} (I-Z) \otimes (I-Z) \otimes X \right).\]
- final class parityos.operators.controlled_operator.CCRY(control_qubits: QubitT_co | Iterable[QubitT_co], target_qubit: QubitT_co, angle: Coefficient = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
MultiControlSingleTargetRotation[QubitT_co,RY[QubitT_co]]Double controlled
RYrotation.\[\mathrm{CCRY}(\theta) = \exp\left(-i \frac{\theta}{8} (I-Z) \otimes (I-Z) \otimes Y \right).\]
- final class parityos.operators.controlled_operator.CCRZ(control_qubits: QubitT_co | Iterable[QubitT_co], target_qubit: QubitT_co, angle: Coefficient = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
MultiControlSingleTargetRotation[QubitT_co,RZ[QubitT_co]]Double controlled
RZrotation.\[\mathrm{CCRZ}(\theta) = \exp\left(-i \frac{\theta}{8} (I-Z) \otimes (I-Z) \otimes Z \right).\]
- final class parityos.operators.controlled_operator.CRXX(control_qubit: QubitT_co, target_qubits, angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
SingleControlUnorderedMultiTargetRotation[QubitT_co,RXX[QubitT_co]]Controlled two-qubit
RXXrotation.\[\mathrm{CRXX}(\theta) = \exp\left(-i \frac{\theta}{4} (I-Z) \otimes X \otimes X \right).\]
- final class parityos.operators.controlled_operator.CRYY(control_qubit: QubitT_co, target_qubits, angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
SingleControlUnorderedMultiTargetRotation[QubitT_co,RYY[QubitT_co]]Controlled two-qubit
RYYrotation.\[\mathrm{CRYY}(\theta) = \exp\left(-i \frac{\theta}{4} (I-Z) \otimes Y \otimes Y \right).\]
- final class parityos.operators.controlled_operator.CRZZ(control_qubit: QubitT_co, target_qubits, angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
SingleControlUnorderedMultiTargetRotation[QubitT_co,RZZ[QubitT_co]]Controlled two-qubit
RZZrotation.\[\mathrm{CRZZ}(\theta) = \exp\left(-i \frac{\theta}{4} (I-Z) \otimes Z \otimes Z \right).\]
- final class parityos.operators.controlled_operator.CRXZ(control_qubit: QubitT_co, ordered_target_qubits, angle: Symbolic | complex = Parameter(name='DEFAULT_ANGLE', assumptions=ParameterAssumptions(zero=None, nonzero=None, positive=None, negative=None, rational=None, irrational=None, integer=None, even=None, odd=None, real=True, finite=True)))¶
Bases:
SingleControlOrderedMultiTargetRotation[QubitT_co,RXZ[QubitT_co]]Controlled two-qubit
RXZrotation.\[\mathrm{CRXZ}(\theta) = \exp\left(-i \frac{\theta}{4} (I-Z) X \otimes Z \right).\]