Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 110 additions & 44 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ quil = ">=0.15.3,<0.18"
packaging = ">=23.1"
deprecated = "^1.2.14"
types-deprecated = "^1.2.9.3"
rigetti-quax = ">=0.7.0"
rigetti-quax = "^0.7.2"

# latex extra
ipython = { version = "^8.16.0", optional = true }
Expand All @@ -40,7 +40,7 @@ Sphinx = { version = "^7.3.7", optional = true }
sphinx-rtd-theme = { version = "^1.3.0,<=2.0.0", optional = true }
nbsphinx = { version = "^0.9.3", optional = true }
myst-parser = { version = "^3.0.1", optional = true }
pandoc = {version = "2.4b0", optional = true}
pandoc = {version = "2.4", optional = true}
matplotlib = {version = "^3.9.0", optional = true}
matplotlib-inline = {version = "^0.1.7", optional = true}
seaborn = {version = "^0.13.2", optional = true}
Expand Down
86 changes: 86 additions & 0 deletions pyquil/noise/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
"""pyquil.noise — Noise modeling for quantum simulators.

This package provides:

- **Noise model** (``_legacy_noise``): Kraus-map based noise construction
for the QVM, including ``KrausModel``, ``NoiseModel``, and decoherence
helpers. This is the public, supported API and is re-exported below; it was
previously the module ``pyquil/noise.py``, and every name it exported is still
importable from ``pyquil.noise``.

- **Channel classes** (``_channels``): quax-backed ``Channel``,
``MeasurementChannel``, ``ResetChannel``, and ``CycleChannel`` dataclasses
for fine-grained noise modeling. These are private and not re-exported.

- **New noise model** (``_noise_model``): The quax-based ``NoiseModel``
container and program-level fidelity estimation utilities. These are
still private and not re-exported; they will become the public API in the
next major version, at which point the legacy Kraus-based model above is
removed.
"""

# ── Noise model (Kraus-map based) ───────────────────────────────────────
# Everything below is re-exported so that moving ``pyquil/noise.py`` into this package is not a
# breaking change. The underscore-prefixed names were never public API, but they are re-exported
# too so that any code reaching for them keeps working.
from pyquil.noise._legacy_noise import (
_CHARS, # noqa: F401
ANGLE_TOLERANCE,
INFINITY,
NO_NOISE,
KrausModel,
NoiseModel,
NoisyGateUndefined,
_apply_local_transforms, # noqa: F401
_bitstring_probs_by_qubit, # noqa: F401
_check_kraus_ops, # noqa: F401
_create_kraus_pragmas, # noqa: F401
_decoherence_noise_model, # noqa: F401
_get_program_gates, # noqa: F401
_KrausModel, # noqa: F401
_noise_model_program_header, # noqa: F401
_NoiseModel, # noqa: F401
_run, # noqa: F401
add_decoherence_noise,
append_kraus_to_gate,
apply_noise_model,
bitstring_probs_to_z_moments,
combine_kraus_maps,
correct_bitstring_probs,
corrupt_bitstring_probs,
damping_after_dephasing,
damping_kraus_map,
decoherence_noise_with_asymmetric_ro,
dephasing_kraus_map,
estimate_assignment_probs,
estimate_bitstring_probs,
get_noisy_gate,
pauli_kraus_map,
tensor_kraus_maps,
)

__all__ = [
# Noise model
"ANGLE_TOLERANCE",
"INFINITY",
"KrausModel",
"NO_NOISE",
"NoiseModel",
"NoisyGateUndefined",
"add_decoherence_noise",
"append_kraus_to_gate",
"apply_noise_model",
"bitstring_probs_to_z_moments",
"combine_kraus_maps",
"correct_bitstring_probs",
"corrupt_bitstring_probs",
"damping_after_dephasing",
"damping_kraus_map",
"decoherence_noise_with_asymmetric_ro",
"dephasing_kraus_map",
"estimate_assignment_probs",
"estimate_bitstring_probs",
"get_noisy_gate",
"pauli_kraus_map",
"tensor_kraus_maps",
]
Loading
Loading