Metadata-Version: 2.1
Name: vqubit
Version: 1.0.0
Summary: A dependency-free quantum computing framework for Python, written in V.
License: MIT
Keywords: quantum,quantum-computing,qubit,circuit,simulator,cirq,vlang
Project-URL: Homepage, https://github.com/rroblf01/vqubit
Project-URL: Repository, https://github.com/rroblf01/vqubit
Project-URL: Documentation, https://rroblf01.github.io/vqubit/
Project-URL: Issues, https://github.com/rroblf01/vqubit/issues
Project-URL: Changelog, https://github.com/rroblf01/vqubit/blob/main/CHANGELOG.md
Requires-Python: >=3.11
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Other
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Typing :: Typed
Description-Content-Type: text/markdown

# vqubit

**A dependency-free quantum computing framework for Python, written in [V](https://vlang.io).**

[![PyPI](https://img.shields.io/pypi/v/vqubit.svg)](https://pypi.org/project/vqubit/)
[![Python versions](https://img.shields.io/pypi/pyversions/vqubit.svg)](https://pypi.org/project/vqubit/)
[![CI](https://github.com/rroblf01/vqubit/actions/workflows/test.yml/badge.svg)](https://github.com/rroblf01/vqubit/actions/workflows/test.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/rroblf01/vqubit/blob/main/LICENSE)

vqubit lets you build quantum circuits and run them on local simulators with
**zero third-party dependencies**. The numerically heavy work — linear algebra,
gate matrices and simulation — is written in V and compiled into a native
extension; the public API is dependency-free Python on top of it.

The API mirrors [Cirq](https://quantumai.google/cirq) closely, so if you know
Cirq you already know vqubit.

```python
import vqubit as vq

q0, q1 = vq.LineQubit.range(2)
circuit = vq.Circuit(vq.H(q0), vq.CNOT(q0, q1), vq.measure(q0, q1, key="result"))
print(circuit)

result = vq.Simulator().run(circuit, repetitions=100)
print(result.histogram(key="result"))
```

## Highlights

- **No dependencies.** `pip install vqubit` installs nothing else. Everything
  runs offline, on your machine.
- **Native speed.** Linear algebra, gate matrices and simulation are compiled
  from V, not interpreted.
- **One wheel, every Python.** A single abi3 wheel covers CPython 3.11–3.15 per
  platform.
- **Cross-platform.** Linux (x86-64 and ARM), macOS (ARM) and Windows (x86-64).
- **Cirq-compatible API.** Build, transform and simulate circuits the way Cirq
  documents them.

## Installation

```console
$ pip install vqubit
```

Requires Python 3.11 or newer. No other packages are installed.

## Documentation

The full documentation is published at **https://rroblf01.github.io/vqubit/**
in both [Spanish](https://rroblf01.github.io/vqubit/) (the default) and
[English](https://rroblf01.github.io/vqubit/en/). It starts from "what is a
qubit?" and builds up to circuits and simulation.

## Status

vqubit is **1.0.0**, and from here the public API follows
[SemVer](https://semver.org/): nothing that works today is removed without a
deprecation cycle first, and an incompatible change means a major version (the
policy is written down in
[Stability and versions](https://rroblf01.github.io/vqubit/en/guide/stability/)).
It exports every one of cirq-core's top-level names except `contrib`, and the
simulators, optimizers, transformers and devices are in place; the call
conventions that still differ are listed in
[Differences from Cirq](https://rroblf01.github.io/vqubit/en/guide/cirq-differences/).
See [CHANGELOG.md](CHANGELOG.md) for the full list and
[ROADMAP.md](ROADMAP.md) for what comes next.

It ships wheels for Linux (x86-64 and ARM), macOS (ARM) and Windows (x86-64),
plus a source distribution, and is built with
[vcraft](https://github.com/rroblf01/vcraft).

## Development

vqubit is built with [vcraft](https://github.com/rroblf01/vcraft). You need the
V compiler, a C compiler, and [uv](https://docs.astral.sh/uv/) for the
development tooling.

```console
$ python -m venv .venv && source .venv/bin/activate
$ pip install vcraft
$ uv pip install --group dev   # pytest, coverage, hypothesis, ruff, ty, build
$ vcraft develop               # build and install into the active virtualenv
$ python main.py               # run the example
$ pytest                       # run the test suite
$ vcraft build --release       # write an abi3 wheel into dist/
```

The dev and docs tooling are `[dependency-groups]` in `pyproject.toml`; use
`uv pip install --group docs` for the documentation toolchain. (`uv pip install`
adds to the virtualenv without pruning it — `uv sync` would remove the editable
extension that `vcraft develop` installs.)

The development setup is the only thing that needs the V toolchain — the
published wheels need nothing.

## Community

- **Contributing**: [CONTRIBUTING.md](CONTRIBUTING.md) explains the setup and
  every check a pull request has to pass.
- **Code of conduct**: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
- **Security**: [SECURITY.md](SECURITY.md) — please report vulnerabilities
  privately, not in a public issue.
- **Citing**: [CITATION.cff](CITATION.cff) (GitHub's "Cite this repository"
  button reads it).

### Acknowledgements

vqubit stands on the design of [Cirq](https://quantumai.google/cirq): its gate
model, its protocols and the shape of its API are Cirq's, and the parity harness
compares the two name by name. The stabilizer simulator follows Aaronson and
Gottesman, *Improved Simulation of Stabilizer Circuits*; the two-qubit
decompositions follow Shende, Bullock and Markov (quant-ph/0308033) and the
fSim synthesis follows arXiv:1910.11333. The native core is written in
[V](https://vlang.io) and built with
[vcraft](https://github.com/rroblf01/vcraft).

## License

MIT. See [LICENSE](LICENSE). © Ricardo Robles Fernández.

