Skip to content

Simple

cx

cx(control: Qubit, target: Qubit)

Apply a controlled-X gate on two qubits.

Parameters:

Name Type Description Default
control Qubit

The control qubit.

required
target Qubit

The target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
200
201
202
203
204
205
206
207
208
@kernel
def cx(control: qubit.Qubit, target: qubit.Qubit):
    """Apply a controlled-X gate on two qubits.

    Args:
        control (qubit.Qubit): The control qubit.
        target (qubit.Qubit): The target qubit.
    """
    broadcast.cx(ilist.IList([control]), ilist.IList([target]))

cy

cy(control: Qubit, targets: Qubit)

Apply a controlled-Y gate on two qubits.

Parameters:

Name Type Description Default
control Qubit

The control qubit.

required
targets Qubit

The target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
211
212
213
214
215
216
217
218
219
@kernel
def cy(control: qubit.Qubit, targets: qubit.Qubit):
    """Apply a controlled-Y gate on two qubits.

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

cz

cz(control: Qubit, target: Qubit)

Apply a controlled-Z gate on two qubits.

Parameters:

Name Type Description Default
control Qubit

The control qubit.

required
target Qubit

The target qubit.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
189
190
191
192
193
194
195
196
197
@kernel
def cz(control: qubit.Qubit, target: qubit.Qubit):
    """Apply a controlled-Z gate on two qubits.

    Args:
        control (qubit.Qubit): The control qubit.
        target (qubit.Qubit): The target qubit.
    """
    broadcast.cz(ilist.IList([control]), ilist.IList([target]))

h

h(qubit: Qubit)

Apply a Hadamard gate on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the Hadamard gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
132
133
134
135
136
137
138
139
@kernel
def h(qubit: qubit.Qubit):
    """Apply a Hadamard gate on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the Hadamard gate to.
    """
    broadcast.h(ilist.IList([qubit]))

rot

rot(phi: float, theta: float, omega: float, qubit: Qubit)

Apply a general single-qubit rotation on a single qubit.

Parameters:

Name Type Description Default
phi float

Z rotation before Y (radians).

required
theta float

Y rotation (radians).

required
omega float

Z rotation after Y (radians).

required
qubit Qubit

The qubit to apply the rotation to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
163
164
165
166
167
168
169
170
171
172
173
@kernel
def rot(phi: float, theta: float, omega: float, qubit: qubit.Qubit):
    """Apply a general single-qubit rotation on a single qubit.

    Args:
        phi (float): Z rotation before Y (radians).
        theta (float): Y rotation (radians).
        omega (float): Z rotation after Y (radians).
        qubit (qubit.Qubit): The qubit to apply the rotation to.
    """
    broadcast.rot(phi, theta, omega, ilist.IList([qubit]))

rx

rx(angle: float, qubit: Qubit)

Apply an RX rotation gate on a single qubit.

Parameters:

Name Type Description Default
angle float

Rotation angle in radians.

required
qubit Qubit

The qubit to apply the rotation to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
 9
10
11
12
13
14
15
16
17
@kernel
def rx(angle: float, qubit: qubit.Qubit):
    """Apply an RX rotation gate on a single qubit.

    Args:
        angle (float): Rotation angle in radians.
        qubit (qubit.Qubit): The qubit to apply the rotation to.
    """
    broadcast.rx(angle, ilist.IList([qubit]))

ry

ry(angle: float, qubit: Qubit)

Apply an RY rotation gate on a single qubit.

Parameters:

Name Type Description Default
angle float

Rotation angle in radians.

required
qubit Qubit

The qubit to apply the rotation to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
50
51
52
53
54
55
56
57
58
@kernel
def ry(angle: float, qubit: qubit.Qubit):
    """Apply an RY rotation gate on a single qubit.

    Args:
        angle (float): Rotation angle in radians.
        qubit (qubit.Qubit): The qubit to apply the rotation to.
    """
    broadcast.ry(angle, ilist.IList([qubit]))

rz

rz(angle: float, qubit: Qubit)

Apply an RZ rotation gate on a single qubit.

Parameters:

Name Type Description Default
angle float

Rotation angle in radians.

required
qubit Qubit

The qubit to apply the rotation to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
91
92
93
94
95
96
97
98
99
@kernel
def rz(angle: float, qubit: qubit.Qubit):
    """Apply an RZ rotation gate on a single qubit.

    Args:
        angle (float): Rotation angle in radians.
        qubit (qubit.Qubit): The qubit to apply the rotation to.
    """
    broadcast.rz(angle, ilist.IList([qubit]))

s

s(qubit: Qubit)

Apply an S gate on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the S gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
112
113
114
115
116
117
118
119
@kernel
def s(qubit: qubit.Qubit):
    """Apply an S gate on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the S gate to.
    """
    broadcast.s(ilist.IList([qubit]))

s_dag

s_dag(qubit: Qubit)

Apply the adjoint of the S gate on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the adjoint S gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
122
123
124
125
126
127
128
129
@kernel
def s_dag(qubit: qubit.Qubit):
    """Apply the adjoint of the S gate on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the adjoint S gate to.
    """
    broadcast.s_adj(ilist.IList([qubit]))

shift

shift(angle: float, qubit: Qubit)

Apply a phase shift on the |1> state of a single qubit.

Parameters:

Name Type Description Default
angle float

Shift angle in radians.

required
qubit Qubit

The qubit to apply the shift to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
152
153
154
155
156
157
158
159
160
@kernel
def shift(angle: float, qubit: qubit.Qubit):
    """Apply a phase shift on the |1> state of a single qubit.

    Args:
        angle (float): Shift angle in radians.
        qubit (qubit.Qubit): The qubit to apply the shift to.
    """
    broadcast.shift(angle, ilist.IList([qubit]))

sqrt_x

sqrt_x(qubit: Qubit)

Apply a sqrt(X) gate on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the sqrt(X) gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
30
31
32
33
34
35
36
37
@kernel
def sqrt_x(qubit: qubit.Qubit):
    """Apply a sqrt(X) gate on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the sqrt(X) gate to.
    """
    broadcast.sqrt_x(ilist.IList([qubit]))

sqrt_x_adj

sqrt_x_adj(qubit: Qubit)

Apply the adjoint of sqrt(X) on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the adjoint sqrt(X) gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
40
41
42
43
44
45
46
47
@kernel
def sqrt_x_adj(qubit: qubit.Qubit):
    """Apply the adjoint of sqrt(X) on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the adjoint sqrt(X) gate to.
    """
    broadcast.sqrt_x_adj(ilist.IList([qubit]))

sqrt_y

sqrt_y(qubit: Qubit)

Apply a sqrt(Y) gate on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the sqrt(Y) gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
71
72
73
74
75
76
77
78
@kernel
def sqrt_y(qubit: qubit.Qubit):
    """Apply a sqrt(Y) gate on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the sqrt(Y) gate to.
    """
    broadcast.sqrt_y(ilist.IList([qubit]))

sqrt_y_adj

sqrt_y_adj(qubit: Qubit)

Apply the adjoint of sqrt(Y) on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the adjoint sqrt(Y) gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
81
82
83
84
85
86
87
88
@kernel
def sqrt_y_adj(qubit: qubit.Qubit):
    """Apply the adjoint of sqrt(Y) on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the adjoint sqrt(Y) gate to.
    """
    broadcast.sqrt_y_adj(ilist.IList([qubit]))

t

t(qubit: Qubit)

Apply a T gate on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the T gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
142
143
144
145
146
147
148
149
@kernel
def t(qubit: qubit.Qubit):
    """Apply a T gate on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the T gate to.
    """
    broadcast.t(ilist.IList([qubit]))

u3

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

Apply the U3 gate on a single qubit.

Parameters:

Name Type Description Default
theta float

Rotation angle around the Y axis in radians.

required
phi float

Rotation angle around the Z axis in radians.

required
lam float

Rotation angle around the Z axis in radians.

required
qubit Qubit

The qubit to apply the U3 gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
176
177
178
179
180
181
182
183
184
185
186
@kernel
def u3(theta: float, phi: float, lam: float, qubit: qubit.Qubit):
    """Apply the U3 gate on a single qubit.

    Args:
        theta (float): Rotation angle around the Y axis in radians.
        phi (float): Rotation angle around the Z axis in radians.
        lam (float): Rotation angle around the Z axis in radians.
        qubit (qubit.Qubit): The qubit to apply the U3 gate to.
    """
    broadcast.u3(theta, phi, lam, ilist.IList([qubit]))

x

x(qubit: Qubit)

Apply a Pauli-X gate on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the X gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
20
21
22
23
24
25
26
27
@kernel
def x(qubit: qubit.Qubit):
    """Apply a Pauli-X gate on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the X gate to.
    """
    broadcast.x(ilist.IList([qubit]))

y

y(qubit: Qubit)

Apply a Pauli-Y gate on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the Y gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
61
62
63
64
65
66
67
68
@kernel
def y(qubit: qubit.Qubit):
    """Apply a Pauli-Y gate on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the Y gate to.
    """
    broadcast.y(ilist.IList([qubit]))

z

z(qubit: Qubit)

Apply a Pauli-Z gate on a single qubit.

Parameters:

Name Type Description Default
qubit Qubit

The qubit to apply the Z gate to.

required
Source code in .venv/lib/python3.12/site-packages/bloqade/native/stdlib/simple.py
102
103
104
105
106
107
108
109
@kernel
def z(qubit: qubit.Qubit):
    """Apply a Pauli-Z gate on a single qubit.

    Args:
        qubit (qubit.Qubit): The qubit to apply the Z gate to.
    """
    broadcast.z(ilist.IList([qubit]))