CRYGate

class CRYGate(theta, label=None, ctrl_state=None)[source]

Controlled-RY gate.

Circuit symbol:

q_0: ────■────

┌───┴───┐

q_1: ┤ Ry(ϴ) ├

└───────┘

Matrix representation:

\[ \begin{align}\begin{aligned}\newcommand{\th}{\frac{\theta}{2}}\\\begin{split}CRY(\theta)\ q_0, q_1 = I \otimes |0\rangle\langle 0| + RY(\theta) \otimes |1\rangle\langle 1| = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & \cos{\th} & 0 & -\sin{\th} \\ 0 & 0 & 1 & 0 \\ 0 & \sin{\th} & 0 & \cos{\th} \end{pmatrix}\end{split}\end{aligned}\end{align} \]

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: ┤ Ry(ϴ) ├
     └───┬───┘
q_1: ────■────
\[ \begin{align}\begin{aligned}\newcommand{\th}{\frac{\theta}{2}}\\\begin{split}CRY(\theta)\ q_1, q_0 = |0\rangle\langle 0| \otimes I + |1\rangle\langle 1| \otimes RY(\theta) = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & \cos{\th} & -\sin{\th} \\ 0 & 0 & \sin{\th} & \cos{\th} \end{pmatrix}\end{split}\end{aligned}\end{align} \]

Create new CRY gate.

Attributes

CRYGate.ctrl_state

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

CRYGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

CRYGate.definition

Return definition in terms of other basic gates.

CRYGate.label

Return gate label

CRYGate.params

return instruction params.

Methods

CRYGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

CRYGate.assemble()

Assemble a QasmQobjInstruction

CRYGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

CRYGate.c_if(classical, val)

Add classical condition on register classical and value val.

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

Return controlled version of gate.

CRYGate.copy([name])

Copy of the instruction.

CRYGate.inverse()

Return inverse RY gate (i.e.

CRYGate.is_parameterized()

Return True .IFF.

CRYGate.mirror()

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

CRYGate.power(exponent)

Creates a unitary gate as gate^exponent.

CRYGate.qasm()

Return a default OpenQASM string for the instruction.

CRYGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

CRYGate.to_matrix()

Return a Numpy.array for the gate unitary matrix.