Gates¶
piqture.gates.two_qubit_unitary module¶
Two-Qubit Unitary Gate class
- class piqture.gates.two_qubit_unitary.TwoQubitUnitary¶
Bases:
UnitaryBlock
Implements two qubit unitary with alternative parameterizations.
- auxiliary_parameterization(parameter_vector: ParameterVector, complex_structure: bool = True)¶
Used to build a unitary gate parameterization with the help of an auxiliary qubit.
- static complex_general_block(parameter_vector: ParameterVector) tuple[QuantumCircuit, ParameterVector] ¶
Builds a two-qubit unitary gate with a general parameterization, consisting of complex gates, as given in the following reference paper.
- Reference:
[1] F. Vatan and C. Williams, “Optimal quantum circuits for general two-qubit gates,” Physical Review A, vol. 69, no. 3, Mar. 2004, doi: https://doi.org/10.1103/physreva.69.032315.
- Args:
parameter_vector (ParameterVector): list of parameters of the unitary gates.
- static complex_simple_block(parameter_vector: ParameterVector) tuple[QuantumCircuit, ParameterVector] ¶
Builds a two-qubit unitary gate with simple parameterization, consisting of complex two single-unitary gates (either Rx, Ry, or Rz) followed by a CNOT gate as given in the following paper.
- References:
[1] E. Grant et al., “Hierarchical quantum classifiers,” npj Quantum Information, vol. 4, no. 1, Dec. 2018, doi: https://doi.org/10.1038/s41534-018-0116-9.
- Args:
parameter_vector (ParameterVector): list of parameters of the unitary gates.
- general_parameterization(parameter_vector: ParameterVector, complex_structure: bool = True) tuple[QuantumCircuit, ParameterVector] ¶
Used to build a unitary gate with real or complex general parameterization.
- static real_general_block(parameter_vector: ParameterVector) tuple[QuantumCircuit, ParameterVector] ¶
Builds a two-qubit unitary gate with a general parameterization, consisting of real gates only, as given in the following reference paper.
- Reference:
[1] F. Vatan and C. Williams, “Optimal quantum circuits for general two-qubit gates,” Physical Review A, vol. 69, no. 3, Mar. 2004, doi: https://doi.org/10.1103/physreva.69.032315.
- Args:
parameter_vector (ParameterVector): list of parameters of the unitary gates.
- static real_simple_block(parameter_vector: ParameterVector) tuple[QuantumCircuit, ParameterVector] ¶
Builds a two-qubit unitary gate with simple parameterization, consisting of real two single-unitary gates followed by a CNOT gate as given in the following paper.
- References:
[1] E. Grant et al., “Hierarchical quantum classifiers,” npj Quantum Information, vol. 4, no. 1, Dec. 2018, doi: https://doi.org/10.1038/s41534-018-0116-9.
- Args:
parameter_vector (ParameterVector): list of parameters of the unitary gates.
- simple_parameterization(parameter_vector: ParameterVector, complex_structure: bool = True) tuple[QuantumCircuit, ParameterVector] ¶
Used to build a unitary gate with real or complex simple parameterization.
piqture.gates.unitary_block module¶
Unitary Gate class
- class piqture.gates.unitary_block.UnitaryBlock¶
Bases:
ABC
Implements a unitary block with real and complex implementations. This block can be implemented in 3 ways, as mentioned by Grant et al. (2018)
simple, general and auxiliary gate implementations.
These implementations are called alternative parameterizations.
- abstractmethod auxiliary_parameterization(parameter_vector: list, complex_structure: bool = True)¶
Used to build a unitary gate parameterization with the help of an auxiliary qubit.
- abstractmethod general_parameterization(parameter_vector: list, complex_structure: bool = True)¶
Used to build a unitary gate with real or complex general parameterization.
- abstractmethod simple_parameterization(parameter_vector: list, complex_structure: bool = True)¶
Used to build a unitary gate with real or complex simple parameterization.