CYGate

class CYGate(label=None, ctrl_state=None)[source]

Controlled-Y gate.

Circuit symbol:

q_0: ──■──
     ┌─┴─┐
q_1: ┤ Y ├
     └───┘

Matrix representation:

\[\begin{split}CY\ q_0, q_1 = I \otimes |0 \rangle\langle 0| + Y \otimes |1 \rangle\langle 1| = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & -i \\ 0 & 0 & 1 & 0 \\ 0 & i & 0 & 0 \end{pmatrix}\end{split}\]

Note

In Qiskit’s convention, higher qubit indices are more significant (little endian convention). In many textbooks, controlled gates are presented with the assumption of more significant qubits as control, which in our case would be q_1. Thus a textbook matrix for this gate will be:

     ┌───┐
q_0: ┤ Y ├
     └─┬─┘
q_1: ──■──
\[\begin{split}CY\ q_1, q_0 = |0 \rangle\langle 0| \otimes I + |1 \rangle\langle 1| \otimes Y = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & -i \\ 0 & 0 & i & 0 \end{pmatrix}\end{split}\]

Create new CY gate.

Attributes

CYGate.ctrl_state

Return the control state of the gate as a decimal integer.

CYGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

CYGate.definition

Return definition in terms of other basic gates.

CYGate.label

Return gate label

CYGate.params

return instruction params.

Methods

CYGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

CYGate.assemble()

Assemble a QasmQobjInstruction

CYGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

CYGate.c_if(classical, val)

Add classical condition on register classical and value val.

CYGate.control([num_ctrl_qubits, label, …])

Return controlled version of gate.

CYGate.copy([name])

Copy of the instruction.

CYGate.inverse()

Return inverted CY gate (itself).

CYGate.is_parameterized()

Return True .IFF.

CYGate.mirror()

For a composite instruction, reverse the order of sub-gates.

CYGate.power(exponent)

Creates a unitary gate as gate^exponent.

CYGate.qasm()

Return a default OpenQASM string for the instruction.

CYGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

CYGate.to_matrix()

Return a numpy.array for the CY gate.