Skip to content

Welcome to Quantar

AI-assisted docs. Parts of this page were drafted or edited with AI assistance. The project creator reviews and maintains the final text; see the AI notice.

Quantar (qtr for short) is a Python toolkit for quantum computing and scientific workflows. Because it builds directly on Python, all your existing Python code works out of the box (thank god i didn't have to implement that world class syntax, all hail f-strings) — upgraded with native quantum primitives, physics helpers, and a cargo-style CLI.

Core Features

  • Built-in Quantum Operations: Native quantum gates, state vectors, and simulation tools included directly in the Standard Library (STL).
  • Python First: .qtr files are Python files, extended with binary/unary operators and built-in gate symbols—see the syntax guide.
  • Physics Simulations: Built-in utilities for general physics modeling included in the STL alongside the core quantum stack.

Installation

Install Quantar using pip or uv:

pip install quantar

# Or, if you are a uv fan:
uv add quantar

Quick Example

Save this snippet as hello.qtr and run it to create and measure a simple quantum state:

# hello.qtr
import quantum
from quantum import QuantumComputer, swap_MAT
import quantar


q = QuantumComputer(4)

# ordinary Python still works
for qubit in q.qubits:
    qubit.apply_gate(quantum.h_MAT())

# gate calls
q.apply_gate(swap_MAT(), [0, 1])
q.apply_gate(swap_MAT(), [1, 2])
q.apply_gate(swap_MAT(), [2, 3])

# built-in gate operators
q[0] <-> q[1]
h q[2]

print(q.state_vector)
print(quantar.__version__)
qtr run path/to/hello.qtr

# A bare filename is shorthand for `qtr run`.
qtr path/to/hello.qtr

# Check without running the program or its local imports.
qtr check path/to/hello.qtr

# Lower to ordinary Python.
qtr compile path/to/hello.qtr path/to/hello.py

Next steps

  • Quickstart: install Quantar, create a project, and run it.
  • Syntax: how .qtr files use Python plus binary/unary and gate operators.
  • Standard Library: which imports provide the simulator, algorithms, and physics helpers.
  • Releases: version policy and what changed between releases.
  • AI Notice: how these docs are authored and maintained.