qiu-classical-simulation¶
qiu-classical-simulation provides tools for classical simulations. Its subpackage wave_optics models the paraxial wave optics of a Gaussian beam through a plano-convex lens, sliced along the optical axis into thin transparent plates, and through free space behind it. It holds everything about this lens experiment that does not depend on how the phases are applied: the optical elements as phase signals, the parameters of an experiment and everything derived from them, the simulation loop for any backend, the classical references (exact split-step numerics and thin lens analytics), the storage of runs and their analysis.
The simulations of the monorepo share it: wave_optics_propagation applies the phases with Qiskit circuits and wave_optics_propagation_qutip with QuTiP operators, each implementing a PropagationBackend. The fields and phases are signals of qiu-signals. It depends on NumPy, Matplotlib and qiu-signals.
Installation¶
pip install qiu-classical-simulation
Inside the monorepo, it is installed with all other packages by uv sync --all-packages.
Quick start¶
from qiu_classical_simulation.wave_optics.classical_numerics import (
classical_numerics_simulation,
)
from qiu_classical_simulation.wave_optics.cli import parse_parameters
from qiu_classical_simulation.wave_optics.simulation import ExactBackend, simulate
# the experiment of the paper, on a small grid with few lens slices
parameters, _ = parse_parameters(
"", ".result", ["--max-delta=0.1", "--num-qubits=5", "--lens-slices=20"]
)
result = simulate(parameters, ExactBackend())
behind_lens = parameters.step_size_after_lens * parameters.num_of_steps_after_lens
reference = classical_numerics_simulation(parameters, behind_lens)
assert abs(abs(result.snapshots["final"] @ reference.conj()) - 1) < 1e-9
Where next¶
- The User Guide explains the physical model, the parameters of an experiment, the simulation loop and its backends, the references, the storage and the analysis.
- The Examples compare a simulation with the thin lens analytics, implement a backend of the phase protocol, store and load runs and follow a beam through free space.
- The API Reference documents every public object, generated from the docstrings, e.g. of the subpackage
wave_optics.