Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK. Go to the latest version.

qiskit.ignis.verification.CNOTDihedral

class CNOTDihedral(data, validate=True)

GitHub

CNOT-dihedral Object Class. The CNOT-dihedral group on num_qubits qubits is generated by the gates CNOT, T and X.

References

  1. Shelly Garion and Andrew W. Cross, On the structure of the CNOT-Dihedral group, arXiv:2006.12042 [quant-ph]
  2. 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.

__init__

__init__(data, validate=True)

Initialize a CNOTDihedral operator object.


Methods

__init__(data[, validate])Initialize a CNOTDihedral operator object.
add(other)Return the linear operator self + other.
adjoint()Return the conjugate transpose of the CNOTDihedral element
cnot(i, j)Apply a CNOT gate to this element.
compose(other[, qargs, front])Return the composed operator.
conjugate()Return the conjugate of the CNOTDihedral element.
copy()Make a deep copy of current operator.
dot(other[, qargs])Return the right multiplied operator self * other.
expand(other)Return the tensor product operator: other tensor self.
flip(i)Apply X to this element.
from_circuit(circuit)Initialize from a QuantumCircuit or Instruction.
input_dims([qargs])Return tuple of input dimension for specified subsystems.
is_cnotdihedral()Return True if input is a CNOTDihedral element.
multiply(other)Return the linear operator other * self.
output_dims([qargs])Return tuple of output dimension for specified subsystems.
phase(k, i)Apply an k-th power of T to this element.
power(n)Return the compose of a operator with itself n times.
reshape([input_dims, output_dims])Return a shallow copy with reshaped input and output subsystem dimensions.
set_atol(value)Set the class default absolute tolerance parameter for float comparisons.
set_rtol(value)Set the class default relative tolerance parameter for float comparisons.
subtract(other)Return the linear operator self - other.
tensor(other)Return the tensor product operator: self tensor other.
to_circuit()Return a QuantumCircuit implementing the CNOT-Dihedral element.
to_instruction()Return a Gate instruction implementing the CNOTDihedral object.
to_matrix()Convert operator to Numpy matrix.
to_operator()Convert to an Operator object.
transpose()Return the transpose of the CNOT-Dihedral element.

Attributes

atolThe default absolute tolerance parameter for float comparisons.
dimReturn tuple (input_shape, output_shape).
keyReturn a string representation of a CNOT-dihedral object.
num_qubitsReturn the number of qubits if a N-qubit operator or None otherwise.
qargsReturn the qargs for the operator.
rtolThe relative tolerance parameter for float comparisons.

add

add(other)

Return the linear operator self + other.

DEPRECATED: use operator + other instead.

Parameters

other (BaseOperator) – an operator object.

Returns

the operator self + other.

Return type

BaseOperator

adjoint

adjoint()

Return the conjugate transpose of the CNOTDihedral element

atol

The default absolute tolerance parameter for float comparisons.

cnot

cnot(i, j)

Apply a CNOT gate to this element. Left multiply the element by CNOT_{i,j}.

compose

compose(other, qargs=None, front=False)

Return the composed operator.

Parameters

  • other (CNOTDihedral) – an operator object.
  • qargs (None) – using specific qargs is not implemented for this operator.
  • front (bool) – if True compose using right operator multiplication, instead of left multiplication [default: False].

Returns

The operator self @ other.

Return type

CNOTDihedral

Raises

  • QiskitError – if operators have incompatible dimensions for composition.
  • NotImplementedError – if qargs is not None.

Additional Information:

Composition (@) is defined as left matrix multiplication for matrix operators. That is that A @ B is equal to B * A. Setting front=True returns right matrix multiplication A * B and is equivalent to the dot() method.

conjugate

conjugate()

Return the conjugate of the CNOTDihedral element.

copy

copy()

Make a deep copy of current operator.

dim

Return tuple (input_shape, output_shape).

dot

dot(other, qargs=None)

Return the right multiplied operator self * other.

Parameters

  • other (CNOTDihedral) – an operator object.
  • qargs (None) – using specific qargs is not implemented for this operator.

Returns

The operator self * other.

Return type

CNOTDihedral

Raises

  • QiskitError – if operators have incompatible dimensions for composition.
  • NotImplementedError – if qargs is not None.

expand

expand(other)

Return the tensor product operator: other tensor self.

Parameters

other (CNOTDihedral) – an operator subclass object.

Returns

the tensor product operator: other tensor other.

Return type

CNOTDihedral

flip

flip(i)

Apply X to this element. Left multiply the element by X_i.

from_circuit

from_circuit(circuit)

Initialize from a QuantumCircuit or Instruction.

Parameters

circuit (QuantumCircuit orInstruction) – instruction to initialize.

Returns

the CNOTDihedral object for the circuit.

Return type

CNOTDihedral

Raises

QiskitError – if the input instruction is not CNOTDihedral or contains classical register instruction.

input_dims

input_dims(qargs=None)

Return tuple of input dimension for specified subsystems.

is_cnotdihedral

is_cnotdihedral()

Return True if input is a CNOTDihedral element.

key

Return a string representation of a CNOT-dihedral object.

multiply

multiply(other)

Return the linear operator other * self.

DEPRECATED: use other * operator instead.

Parameters

other (complex) – a complex number.

Returns

the linear operator other * self.

Return type

BaseOperator

Raises

NotImplementedError – if subclass does not support multiplication.

num_qubits

Return the number of qubits if a N-qubit operator or None otherwise.

output_dims

output_dims(qargs=None)

Return tuple of output dimension for specified subsystems.

phase

phase(k, i)

Apply an k-th power of T to this element. Left multiply the element by T_i^k.

power

power(n)

Return the compose of a operator with itself n times.

Parameters

n (int) – the number of times to compose with self (n>0).

Returns

the n-times composed operator.

Return type

BaseOperator

Raises

QiskitError – if the input and output dimensions of the operator are not equal, or the power is not a positive integer.

qargs

Return the qargs for the operator.

reshape

reshape(input_dims=None, output_dims=None)

Return a shallow copy with reshaped input and output subsystem dimensions.

Arg:

input_dims (None or tuple): new subsystem input dimensions.

If None the original input dims will be preserved [Default: None].

output_dims (None or tuple): new subsystem output dimensions.

If None the original output dims will be preserved [Default: None].

Returns

returns self with reshaped input and output dimensions.

Return type

BaseOperator

Raises

QiskitError – if combined size of all subsystem input dimension or subsystem output dimensions is not constant.

rtol

The relative tolerance parameter for float comparisons.

set_atol

classmethod set_atol(value)

Set the class default absolute tolerance parameter for float comparisons.

DEPRECATED: use operator.atol = value instead

set_rtol

classmethod set_rtol(value)

Set the class default relative tolerance parameter for float comparisons.

DEPRECATED: use operator.rtol = value instead

subtract

subtract(other)

Return the linear operator self - other.

DEPRECATED: use operator - other instead.

Parameters

other (BaseOperator) – an operator object.

Returns

the operator self - other.

Return type

BaseOperator

tensor

tensor(other)

Return the tensor product operator: self tensor other.

Parameters

other (CNOTDihedral) – an operator subclass object.

Returns

the tensor product operator: self tensor other.

Return type

CNOTDihedral

to_circuit

to_circuit()

Return a QuantumCircuit implementing the CNOT-Dihedral element.

Returns

a circuit implementation of the CNOTDihedral object.

Return type

QuantumCircuit

Remark:

Decompose 1 and 2-qubit CNOTDihedral elements.

References

  1. Shelly Garion and Andrew W. Cross, On the structure of the CNOT-Dihedral group, arXiv:2006.12042 [quant-ph]
  2. 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).

to_instruction

to_instruction()

Return a Gate instruction implementing the CNOTDihedral object.

to_matrix

to_matrix()

Convert operator to Numpy matrix.

to_operator

to_operator()

Convert to an Operator object.

transpose

transpose()

Return the transpose of the CNOT-Dihedral element.

Was this page helpful?
Report a bug or request content on GitHub.