Classiq's New Pauli Operator Syntax
Classiq’s Qmod quantum programming language fully supports classical structs, similar to common classical programming languages. We recently added a specialized syntax for constructing Pauli operators, a classical struct that appears frequently in quantum computing. For example, the following Qmod Python expression
H = 0.5 * Pauli.Z(0) * Pauli.Y(1) * Pauli.X(2) + 0.8 * Pauli.X(1)
describes a Pauli operator with two terms, 0.5⋅X⊗Y⊗Z
and 0.8⋅I⊗X⊗I
. These Pauli operators can be used, for instance, as an argument to Classiq’s Suzuki-Trotter function and also to describe the observable when estimating the expectation value.
For example, the following model creates a Pauli operator using the new syntax and send it to suzuki_trotter
:
from classiq import *
@qfunc
def main() -> None:
q = QArray(length=4)
allocate(q)
H = 0.5 * Pauli.Z(0) * Pauli.Y(1) * Pauli.X(2) + 0.8 * Pauli.X(1)
suzuki_trotter(H, 1, 1, 1, q)
After synthesizing the model, we can analyze the resulting circuit on the Classiq Platform:

Classiq’s Qmod quantum programming language fully supports classical structs, similar to common classical programming languages. We recently added a specialized syntax for constructing Pauli operators, a classical struct that appears frequently in quantum computing. For example, the following Qmod Python expression
H = 0.5 * Pauli.Z(0) * Pauli.Y(1) * Pauli.X(2) + 0.8 * Pauli.X(1)
describes a Pauli operator with two terms, 0.5⋅X⊗Y⊗Z
and 0.8⋅I⊗X⊗I
. These Pauli operators can be used, for instance, as an argument to Classiq’s Suzuki-Trotter function and also to describe the observable when estimating the expectation value.
For example, the following model creates a Pauli operator using the new syntax and send it to suzuki_trotter
:
from classiq import *
@qfunc
def main() -> None:
q = QArray(length=4)
allocate(q)
H = 0.5 * Pauli.Z(0) * Pauli.Y(1) * Pauli.X(2) + 0.8 * Pauli.X(1)
suzuki_trotter(H, 1, 1, 1, q)
After synthesizing the model, we can analyze the resulting circuit on the Classiq Platform:

About "The Qubit Guy's Podcast"
Hosted by The Qubit Guy (Yuval Boger, our Chief Marketing Officer), the podcast hosts thought leaders in quantum computing to discuss business and technical questions that impact the quantum computing ecosystem. Our guests provide interesting insights about quantum computer software and algorithm, quantum computer hardware, key applications for quantum computing, market studies of the quantum industry and more.
If you would like to suggest a guest for the podcast, please contact us.