cr1Gate
Installation Required: This functionality requires MATLAB Support Package for Quantum Computing.
Description
applies a controlled R1 gate (controlled z-axis rotation gate with global
phase) to a target qubit based on the state of a control qubit and returns a g
= cr1Gate(controlQubit
,targetQubit
,theta
)quantum.gate.SimpleGate
object. If the control qubit is in the state, then this gate does nothing. If the control qubit is in the state, then this gate changes the phase of the target qubit state by an angle of theta
.
If
controlQubit
,targetQubit
, andtheta
are vectors of the same length,cr1Gate
returns a column vector of gates, whereg(i)
represents a controlled R1 gate applied to thei
th element triplet ofcontrolQubit
,targetQubit
, andtheta
.If any of
controlQubit
,targetQubit
, ortheta
is a scalar, and at least one of the inputs is a vector, then MATLAB® expands the scalar to match the size of the vector input.The qubit indices in each element pair of
controlQubit
andtargetQubit
must not be the same.
Examples
Input Arguments
More About
Version History
Introduced in R2023a
See Also
quantumCircuit
| quantum.gate.SimpleGate
| r1Gate
| crxGate
| cryGate
| crzGate
| getMatrix