Referencia de la API¶
Esta sección se genera automáticamente a partir de los docstrings del código.
Paquete vqubit¶
La API pública es plana: todo se accede como vqubit.Algo. La implementación
está organizada en módulos internos, pero solo necesitas recordar el nombre del
paquete.
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"))
Módulo nativo vqubit_native¶
El trabajo pesado (álgebra lineal, matrices de puertas y simulación) vive en la
extensión nativa vqubit_native. No necesitas importarla directamente: el
paquete vqubit la envuelve, y su contenido es un detalle de implementación.