Classiq
High-level quantum algorithm synthesis and optimization platform
Quick install
pip install classiq Background and History
Classiq was founded in 2020 by Nir Minerbi (CEO), Amir Naveh, and Yehuda Naveh in Tel Aviv, Israel. The company was established on the premise that hand-writing gate-level quantum circuits does not scale to the complexity required for practical quantum applications. Instead of building another circuit construction library, Classiq developed a synthesis-based approach: users describe quantum algorithms at a high level of abstraction, and Classiq’s engine automatically generates optimized gate-level implementations that satisfy specified constraints on qubit count, circuit depth, and target hardware.
Classiq raised significant venture capital to develop its platform, including a $33 million Series B round in 2022. The company developed QMOD, its own domain-specific language for describing quantum functions declaratively. In QMOD, operations like quantum arithmetic, state preparation, and oracle construction are expressed as high-level function calls rather than explicit gate sequences. The synthesis engine then searches for implementations that minimize resource usage for the chosen hardware backend.
The platform initially launched as a web-based IDE with a visual circuit analyzer. Over time, Classiq added a Python SDK (available via pip install classiq) that allows programmatic model construction, synthesis, and execution. The open-source classiq-library repository on GitHub provides reference implementations of common algorithms (QAOA, Grover’s search, quantum Fourier transform, chemistry ansatze) expressed as Classiq models. These examples serve both as documentation and as starting points for custom applications.
Classiq supports compilation and deployment to multiple hardware backends, including IBM Quantum, IonQ, Quantinuum, Amazon Braket, and Azure Quantum. This cross-platform capability makes it useful for teams benchmarking algorithms across different hardware modalities. As of 2025, Classiq is actively developed and positions itself as an enterprise-focused platform for organizations building production quantum applications. The company has partnerships with hardware providers and has been adopted by several research institutions and corporate quantum computing teams. Its high-level approach is distinctive in the ecosystem, sitting above framework-level tools like Qiskit and Cirq in the abstraction hierarchy.
Classiq takes a fundamentally different approach to quantum programming: instead of writing gate-level circuits by hand, you describe what a circuit should compute using a functional model, and Classiq’s synthesis engine generates an optimized implementation. The platform’s own domain-specific language, QMOD, lets you specify quantum functions, register sizes, and arithmetic operations at a high level of abstraction. Common building blocks like state preparation, arithmetic (addition, multiplication, comparison), and oracles can be expressed in one or two lines of QMOD rather than hundreds of gates.
The synthesis engine performs hardware-aware optimization, respecting connectivity constraints, gate sets, and qubit counts for the target backend. A single Classiq model can be compiled and deployed across IBM Quantum, IonQ, Azure Quantum, and Amazon Braket without manually re-mapping or retranspiling circuits. This backend portability is especially useful for benchmarking algorithms across different hardware modalities (superconducting, trapped ion, neutral atom).
Classiq is well suited for teams building production quantum applications where circuit depth and qubit efficiency matter at scale. Its web IDE provides interactive circuit visualization and analysis. The open-source classiq-library repository contains reference implementations of common algorithms (QAOA, QFT, Grover, quantum chemistry ansatze) expressed as Classiq models, which serve as starting points for customization.
Key Imports
import classiq
from classiq import (
Model, create_model, synthesize, execute, show,
QInt, QUInt, QArray, QBit,
H, X, CX, RZ, SWAP,
Output, Input,
qfunc, allocate, control, repeat,
set_constraints, set_preferences,
Constraints, Preferences,
ClassiqBackendPreferences, ClassiqSimulatorBackendPreferences
)
from classiq.execution import ExecutionPreferences
Core Concepts
The @qfunc decorator. All quantum logic in Classiq’s Python SDK is defined inside functions decorated with @qfunc. These functions describe quantum operations at a high level. They do not execute immediately; instead, they build a QMOD model that the synthesis engine will compile into a gate-level circuit.
QMOD model. QMOD (Quantum Model) is Classiq’s internal representation of a quantum program. You construct a QMOD model either by writing Python functions with @qfunc or by using QMOD’s native syntax in the Classiq IDE. The model captures what the circuit should compute without specifying how at the gate level.
Synthesis workflow. The standard pipeline is: define your quantum function with @qfunc, call create_model() to build the QMOD representation, call synthesize() to compile it into an optimized circuit, then call execute() to run it on a simulator or hardware backend. You can call show() at any point after synthesis to visualize the resulting circuit in your browser.
Quantum types. Classiq provides typed quantum registers: QBit (single qubit), QArray (array of qubits), QInt (signed integer register), and QUInt (unsigned integer register). These types let you express arithmetic and logical operations directly on quantum registers without manually managing individual qubits.
Constraints. The Constraints object lets you bound the synthesized circuit’s resources. Key parameters include max_width (maximum qubit count) and max_depth (maximum circuit depth). The synthesis engine searches for implementations that satisfy these bounds.
Preferences. The Preferences object controls backend targeting, optimization goals, and transpilation settings. You can direct the same model to IBM Quantum, IonQ, Quantinuum, or a local simulator by swapping preferences alone.
Common Patterns
Hello World: Superposition
Create a single-qubit superposition, synthesize the circuit, and execute it on the built-in simulator.
import classiq
from classiq import qfunc, allocate, H, QBit, create_model, synthesize, execute, show
@qfunc
def main(res: Output[QBit]):
allocate(1, res) # Allocate a single qubit
H(res) # Apply Hadamard to create |+> state
# Build the model, synthesize, and execute
model = create_model(main)
quantum_program = synthesize(model)
show(quantum_program) # Opens circuit visualization in browser
# Execute on the default simulator
result = execute(quantum_program).result()
print(result[0].value.parsed_counts)
# Expect roughly: [{'res': 0, 'count': ~500}, {'res': 1, 'count': ~500}]
Grover’s search
Classiq provides built-in support for Grover’s algorithm. You define the oracle as a classical predicate on quantum registers, and the synthesis engine constructs the full Grover operator (oracle + diffuser) automatically.
from classiq import (
qfunc, allocate, QUInt, Output,
create_model, synthesize, execute, show,
set_constraints, Constraints
)
from classiq.qmod.builtins import grover_search
# Define the oracle predicate: mark states where x == 5
@qfunc
def my_oracle(x: QUInt):
# Classiq's synthesis engine converts this predicate
# into a phase-marking oracle automatically
pass
@qfunc
def main(x: Output[QUInt]):
allocate(4, x) # 4-qubit search space (0 to 15)
grover_search(
num_reps=3, # Number of Grover iterations
oracle=my_oracle,
target=x
)
model = create_model(main)
model = set_constraints(model, Constraints(max_width=12))
quantum_program = synthesize(model)
show(quantum_program)
result = execute(quantum_program).result()
print(result[0].value.parsed_counts)
# Expect state |5> to appear with high probability
Quantum Fourier Transform
Classiq synthesizes an optimized QFT implementation tailored to the target hardware’s gate set and connectivity.
from classiq import (
qfunc, allocate, QArray, QBit, Output,
create_model, synthesize, execute, show
)
from classiq.qmod.builtins import qft
@qfunc
def main(qbits: Output[QArray[QBit, 4]]):
allocate(4, qbits)
# Prepare an initial state (e.g., encode the integer 3)
X(qbits[0])
X(qbits[1])
# Apply QFT; Classiq generates the optimized decomposition
qft(qbits)
model = create_model(main)
quantum_program = synthesize(model)
show(quantum_program)
result = execute(quantum_program).result()
print(result[0].value.parsed_counts)
The synthesis engine decomposes the QFT into the native gate set of whatever backend you target, applying gate-count and depth optimizations that would be tedious to implement by hand for large register sizes.
QAOA for Max-Cut
Classiq’s QAOA module handles the variational circuit construction and parameter optimization for combinatorial optimization problems.
from classiq import (
create_model, synthesize, execute, show,
set_preferences, Preferences
)
from classiq.applications.combinatorial_optimization import (
OptimizerConfig, QAOAConfig
)
import networkx as nx
# Define the Max-Cut problem as a graph
graph = nx.Graph()
graph.add_edges_from([(0, 1), (1, 2), (2, 3), (3, 0), (0, 2)])
# Configure QAOA
qaoa_config = QAOAConfig(
num_layers=3, # Number of QAOA layers (p=3)
penalty_energy=5.0 # Penalty for constraint violations
)
optimizer_config = OptimizerConfig(
max_iteration=100,
optimizer_type="COBYLA"
)
# Build and synthesize the QAOA model
# (Classiq generates the cost and mixer unitaries from the graph)
model = create_model(
qaoa_config=qaoa_config,
optimizer_config=optimizer_config,
graph=graph,
problem_type="MaxCut"
)
quantum_program = synthesize(model)
show(quantum_program)
result = execute(quantum_program).result()
print("Optimal cut:", result.optimal_solution)
print("Cut value:", result.optimal_value)
Backend targeting
Switch execution between different hardware providers by changing the preferences object. The circuit model stays the same.
from classiq import (
set_preferences, Preferences,
ClassiqBackendPreferences
)
from classiq.execution import ExecutionPreferences
# Target IBM Quantum (requires IBM credentials configured)
ibm_preferences = Preferences(
backend_preferences=ClassiqBackendPreferences(
backend_name="ibm_sherbrooke"
)
)
model = set_preferences(model, ibm_preferences)
# Target IonQ via Amazon Braket
ionq_preferences = Preferences(
backend_preferences=ClassiqBackendPreferences(
backend_name="ionq",
provider="amazon_braket"
)
)
model = set_preferences(model, ionq_preferences)
# Target the built-in Classiq simulator (no credentials needed)
sim_preferences = Preferences(
backend_preferences=ClassiqSimulatorBackendPreferences()
)
model = set_preferences(model, sim_preferences)
# After setting preferences, synthesize and execute as usual
quantum_program = synthesize(model)
result = execute(quantum_program).result()
Classiq vs Low-Level Frameworks
Classiq occupies a different layer in the quantum software stack than frameworks like Qiskit, Cirq, and PennyLane. Those frameworks operate at the gate level: you construct circuits by placing individual gates on qubits, manage qubit allocation manually, and handle transpilation to hardware constraints yourself. Classiq operates at the algorithm level: you describe the computation you want (for example, “add two 8-bit quantum integers” or “apply Grover search with this oracle”), and the synthesis engine generates the gate-level circuit for you.
The trade-off is straightforward. With Classiq, you lose fine-grained control over the exact gate decomposition, which matters when you are researching novel circuit constructions or need to understand every gate in the output. In exchange, you gain a massive reduction in code complexity for standard algorithms and a guarantee that the synthesized circuit respects your hardware constraints. A QAOA circuit that might take 200 lines of Qiskit can often be expressed in under 30 lines of Classiq. For teams focused on applying quantum algorithms to real problems rather than inventing new circuit primitives, this abstraction saves significant development time.
Classiq is not a replacement for Qiskit or Cirq. It is a complementary tool that sits above them. In fact, Classiq can export synthesized circuits to Qiskit or other formats for further inspection or manual modification.
Learning Resources
- Classiq documentation: https://docs.classiq.io/
- Classiq library (open-source examples): https://github.com/Classiq/classiq-library
- Related tutorials on this site: Getting Started with Classiq, High-Level Quantum Programming with Classiq