Skip to content

Gate

cx

cx(control: Qubit, target: Qubit) -> None

Apply a controlled-X gate to a pair of qubits.

Parameters:

Name Type Description Default
controls Qubit

Control qubit.

required
targets Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
182
183
184
185
186
187
188
189
190
@kernel
def cx(control: Qubit, target: Qubit) -> None:
    """Apply a controlled-X gate to a pair of qubits.

    Args:
        controls (Qubit): Control qubit.
        targets (Qubit): Target qubit.
    """
    broadcast.cx(ilist.IList([control]), ilist.IList([target]))

cy

cy(control: Qubit, target: Qubit) -> None

Apply a controlled-Y gate to a pair of qubits.

Parameters:

Name Type Description Default
controls Qubit

Control qubit.

required
targets Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
193
194
195
196
197
198
199
200
201
@kernel
def cy(control: Qubit, target: Qubit) -> None:
    """Apply a controlled-Y gate to a pair of qubits.

    Args:
        controls (Qubit): Control qubit.
        targets (Qubit): Target qubit.
    """
    broadcast.cy(ilist.IList([control]), ilist.IList([target]))

cz

cz(control: Qubit, target: Qubit) -> None

Apply a controlled-Z gate to a pair of qubits.

Parameters:

Name Type Description Default
controls Qubit

Control qubit.

required
targets Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
204
205
206
207
208
209
210
211
212
@kernel
def cz(control: Qubit, target: Qubit) -> None:
    """Apply a controlled-Z gate to a pair of qubits.

    Args:
        controls (Qubit): Control qubit.
        targets (Qubit): Target qubit.
    """
    broadcast.cz(ilist.IList([control]), ilist.IList([target]))

h

h(qubit: Qubit) -> None

Apply a Hadamard gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
39
40
41
42
43
44
45
46
@kernel
def h(qubit: Qubit) -> None:
    """Apply a Hadamard gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.h(ilist.IList([qubit]))

rx

rx(angle: float, qubit: Qubit) -> None

Apply an RX rotation gate to a qubit.

Parameters:

Name Type Description Default
angle float

Rotation angle in radians.

required
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
149
150
151
152
153
154
155
156
157
@kernel
def rx(angle: float, qubit: Qubit) -> None:
    """Apply an RX rotation gate to a qubit.

    Args:
        angle (float): Rotation angle in radians.
        qubit (Qubit): Target qubit.
    """
    broadcast.rx(angle, ilist.IList([qubit]))

ry

ry(angle: float, qubit: Qubit) -> None

Apply an RY rotation gate to a qubit.

Parameters:

Name Type Description Default
angle float

Rotation angle in radians.

required
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
160
161
162
163
164
165
166
167
168
@kernel
def ry(angle: float, qubit: Qubit) -> None:
    """Apply an RY rotation gate to a qubit.

    Args:
        angle (float): Rotation angle in radians.
        qubit (Qubit): Target qubit.
    """
    broadcast.ry(angle, ilist.IList([qubit]))

rz

rz(angle: float, qubit: Qubit) -> None

Apply an RZ rotation gate to a qubit.

Parameters:

Name Type Description Default
angle float

Rotation angle in radians.

required
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
171
172
173
174
175
176
177
178
179
@kernel
def rz(angle: float, qubit: Qubit) -> None:
    """Apply an RZ rotation gate to a qubit.

    Args:
        angle (float): Rotation angle in radians.
        qubit (Qubit): Target qubit.
    """
    broadcast.rz(angle, ilist.IList([qubit]))

s

s(qubit: Qubit) -> None

Apply an S gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
59
60
61
62
63
64
65
66
@kernel
def s(qubit: Qubit) -> None:
    """Apply an S gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.s(ilist.IList([qubit]))

s_adj

s_adj(qubit: Qubit) -> None

Apply the adjoint of an S gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
109
110
111
112
113
114
115
116
@kernel
def s_adj(qubit: Qubit) -> None:
    """Apply the adjoint of an S gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.s_adj(ilist.IList([qubit]))

shift

shift(angle: float, qubit: Qubit) -> None

Apply a phase shift to the |1> state of a qubit. Args: angle (float): Phase shift angle in radians. qubit (Qubit): Target qubit.

Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
235
236
237
238
239
240
241
242
@kernel
def shift(angle: float, qubit: Qubit) -> None:
    """Apply a phase shift to the |1> state of a qubit.
    Args:
        angle (float): Phase shift angle in radians.
        qubit (Qubit): Target qubit.
    """
    broadcast.shift(angle, ilist.IList([qubit]))

sqrt_x

sqrt_x(qubit: Qubit) -> None

Apply a Sqrt(X) gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
69
70
71
72
73
74
75
76
@kernel
def sqrt_x(qubit: Qubit) -> None:
    """Apply a Sqrt(X) gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.sqrt_x(ilist.IList([qubit]))

sqrt_x_adj

sqrt_x_adj(qubit: Qubit) -> None

Apply the adjoint of a Sqrt(X) gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
119
120
121
122
123
124
125
126
@kernel
def sqrt_x_adj(qubit: Qubit) -> None:
    """Apply the adjoint of a Sqrt(X) gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.sqrt_x_adj(ilist.IList([qubit]))

sqrt_y

sqrt_y(qubit: Qubit) -> None

Apply a Sqrt(Y) gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
79
80
81
82
83
84
85
86
@kernel
def sqrt_y(qubit: Qubit) -> None:
    """Apply a Sqrt(Y) gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.sqrt_y(ilist.IList([qubit]))

sqrt_y_adj

sqrt_y_adj(qubit: Qubit) -> None

Apply the adjoint of a Sqrt(Y) gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
129
130
131
132
133
134
135
136
@kernel
def sqrt_y_adj(qubit: Qubit) -> None:
    """Apply the adjoint of a Sqrt(Y) gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.sqrt_y_adj(ilist.IList([qubit]))

sqrt_z

sqrt_z(qubit: Qubit) -> None

Apply a Sqrt(Z) gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
89
90
91
92
93
94
95
96
@kernel
def sqrt_z(qubit: Qubit) -> None:
    """Apply a Sqrt(Z) gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.s(ilist.IList([qubit]))

sqrt_z_adj

sqrt_z_adj(qubit: Qubit) -> None

Apply the adjoint of a Sqrt(Z) gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
139
140
141
142
143
144
145
146
@kernel
def sqrt_z_adj(qubit: Qubit) -> None:
    """Apply the adjoint of a Sqrt(Z) gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.s_adj(ilist.IList([qubit]))

t

t(qubit: Qubit) -> None

Apply a T gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
49
50
51
52
53
54
55
56
@kernel
def t(qubit: Qubit) -> None:
    """Apply a T gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.t(ilist.IList([qubit]))

t_adj

t_adj(qubit: Qubit) -> None

Apply the adjoint of a T gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
 99
100
101
102
103
104
105
106
@kernel
def t_adj(qubit: Qubit) -> None:
    """Apply the adjoint of a T gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.t_adj(ilist.IList([qubit]))

u3

u3(theta: float, phi: float, lam: float, qubit: Qubit)

Apply the U3 gate of a qubit.

The applied gate is represented by the unitary matrix given by:

\[ U3(\theta, \phi, \lambda) = R_z(\phi)R_y(\theta)R_z(\lambda) \]

Parameters:

Name Type Description Default
theta float

Rotation around Y axis (radians).

required
phi float

Global phase shift component (radians).

required
lam float

Z rotations in decomposition (radians).

required
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
@kernel
def u3(theta: float, phi: float, lam: float, qubit: Qubit):
    """Apply the U3 gate of a qubit.

    The applied gate is represented by the unitary matrix given by:

    $$ U3(\\theta, \\phi, \\lambda) = R_z(\\phi)R_y(\\theta)R_z(\\lambda) $$

    Args:
        theta (float): Rotation around Y axis (radians).
        phi (float): Global phase shift component (radians).
        lam (float): Z rotations in decomposition (radians).
        qubit (Qubit): Target qubit.
    """
    broadcast.u3(theta, phi, lam, ilist.IList([qubit]))

x

x(qubit: Qubit) -> None

Apply a Pauli-X gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
 9
10
11
12
13
14
15
16
@kernel
def x(qubit: Qubit) -> None:
    """Apply a Pauli-X gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.x(ilist.IList([qubit]))

y

y(qubit: Qubit) -> None

Apply a Pauli-Y gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
19
20
21
22
23
24
25
26
@kernel
def y(qubit: Qubit) -> None:
    """Apply a Pauli-Y gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.y(ilist.IList([qubit]))

z

z(qubit: Qubit) -> None

Apply a Pauli-Z gate to a qubit.

Parameters:

Name Type Description Default
qubit Qubit

Target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/squin/stdlib/simple/gate.py
29
30
31
32
33
34
35
36
@kernel
def z(qubit: Qubit) -> None:
    """Apply a Pauli-Z gate to a qubit.

    Args:
        qubit (Qubit): Target qubit.
    """
    broadcast.z(ilist.IList([qubit]))