API reference¶
This section is generated automatically from the docstrings in the code.
The vqubit package¶
The public API is flat: everything is reached as vqubit.Something. The
implementation is organised into internal modules, but you only need to remember
the package name.
vqubit ¶
vqubit: a dependency-free quantum computing framework for Python.
vqubit lets you build quantum circuits and run them on local simulators, with
no third-party dependencies at all. The numerically heavy parts -- linear
algebra, gate matrices and simulation -- are written in V and compiled into the
native extension vqubit_native; this package is the public, dependency-free
Python API on top of it.
The public API mirrors Cirq closely::
import vqubit as vq
q0, q1 = vq.LineQubit.range(2)
circuit = vq.Circuit(vq.H(q0), vq.CNOT(q0, q1))
print(circuit)
result = vq.Simulator().run(circuit, repetitions=100)
print(result.histogram(key="result"))
The native module vqubit_native¶
The heavy lifting (linear algebra, gate matrices and simulation) lives in the
native extension vqubit_native. You do not need to import it directly: the
vqubit package wraps it, and its contents are an implementation detail.