CNOTDihedral¶
- class CNOTDihedral(data=None, num_qubits=None, validate=True)[소스]¶
기반 클래스:
BaseOperator
,AdjointMixin
An N-qubit operator from the CNOT-Dihedral group.
The CNOT-Dihedral group is generated by the quantum gates,
CXGate
,TGate
, andXGate
.Representation
An \(N\)-qubit CNOT-Dihedral operator is stored as an affine function and a phase polynomial, based on the convention in references [1, 2].
The affine function consists of an \(N \times N\) invertible binary matrix, and an \(N\) binary vector.
The phase polynomial is a polynomial of degree at most 3, in \(N\) variables, whose coefficients are in the ring Z_8 with 8 elements.
from qiskit import QuantumCircuit from qiskit.quantum_info import CNOTDihedral circ = QuantumCircuit(3) circ.cx(0, 1) circ.x(2) circ.t(1) circ.t(1) circ.t(1) elem = CNOTDihedral(circ) # Print the CNOTDihedral element print(elem)
phase polynomial = 0 + 3*x_0 + 3*x_1 + 2*x_0*x_1 affine function = (x_0,x_0 + x_1,x_2 + 1)
Circuit Conversion
CNOTDihedral operators can be initialized from circuits containing only the following gates:
IGate
,XGate
,YGate
,ZGate
,TGate
,TdgGate
SGate
,SdgGate
,CXGate
,CZGate
,SwapGate
. They can be converted back into aQuantumCircuit
, orGate
object using theto_circuit()
orto_instruction()
methods respectively. Note that this decomposition is not necessarily optimal in terms of number of gates if the number of qubits is more than two.CNOTDihedral operators can also be converted to
Operator
objects using theto_operator()
method. This is done via decomposing to a circuit, and then simulating the circuit as a unitary operator.- References:
Shelly Garion and Andrew W. Cross, Synthesis of CNOT-Dihedral circuits with optimal number of two qubit gates, Quantum 4(369), 2020
Andrew W. Cross, Easwar Magesan, Lev S. Bishop, John A. Smolin and Jay M. Gambetta, Scalable randomised benchmarking of non-Clifford gates, npj Quantum Inf 2, 16012 (2016).
Initialize a CNOTDihedral operator object.
- 매개변수
data (CNOTDihedral or QuantumCircuit or Instruction) – Optional, operator to initialize.
num_qubits (int) – Optional, initialize an empty CNOTDihedral operator.
validate (bool) – if True, validates the CNOTDihedral element.
- 예외 발생
QiskitError – if the type is invalid.
QiskitError – if validate=True and the CNOTDihedral element is invalid.
Methods
Return the adjoint of the Operator.
Return the operator composition with another CNOTDihedral.
Return the conjugate of the CNOTDihedral.
Make a deep copy of current operator.
Return the right multiplied operator self * other.
Return the reverse-order tensor product with another CNOTDihedral.
Return tuple of input dimension for specified subsystems.
Return tuple of output dimension for specified subsystems.
Return the compose of a operator with itself n times.
Return a shallow copy with reshaped input and output subsystem dimensions.
Return the tensor product with another CNOTDihedral.
Return a QuantumCircuit implementing the CNOT-Dihedral element.
Return a Gate instruction implementing the CNOTDihedral object.
Convert operator to Numpy matrix.
Convert to an Operator object.
Return the transpose of the CNOTDihedral.
Attributes
- dim¶
Return tuple (input_shape, output_shape).
- name¶
Unique string identifier for operation type.
- num_clbits¶
Number of classical bits.
- num_qubits¶
Return the number of qubits if a N-qubit operator or None otherwise.
- qargs¶
Return the qargs for the operator.