Gradient-Free Noise Characterization#288
Open
aleramos119 wants to merge 280 commits intomunich-quantum-toolkit:mainfrom
Open
Gradient-Free Noise Characterization#288aleramos119 wants to merge 280 commits intomunich-quantum-toolkit:mainfrom
aleramos119 wants to merge 280 commits intomunich-quantum-toolkit:mainfrom
Conversation
…qt-yaqs into Noise_Characterization
…char folder into core
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
NoiseModel.proccess["name"] accepts directly the BaseGate class and also a string with the name
- Restructure NoiseModel.__init__ process loop: handle 1-site first, then adjacent/non-adjacent 2-site with Crosstalk branching - Move BaseGate to runtime import; get_operator short-circuits on BaseGate instances - Add longrange_crosstalk_* aliases to GateLibrary and _PAULI_STRINGS - Extend is_pauli to handle BaseGate instances via isinstance check - Fix pre-commit issues: split compound asserts, add __init__ docstrings to Crosstalk subclasses, update test docstring - Add .claude/ to .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add local_dim parameter to BaseGate.__init__ (default 2 preserves qubit behaviour); interaction is now computed as log(n)/log(local_dim) and validated to be an integer - Remove power-of-2 restriction from Destroy and Create - Crosstalk inherits local_dim from constituent gates and raises ValueError if they differ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Forward local_dim in all BaseGate methods that return a new gate (dag, conj, trans, __add__, __sub__, __mul__, __matmul__) - Replace PauliX/Y/Z.matrix with X()/Y()/Z().matrix in tests, removing the noise_library import Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Correct Destroy/Create matrix size from 2x2 to d×d - Fix XX/YY/ZZ: replace stale `mpo` attribute with `mpo_tensors` note - Add full Attributes section to Crosstalk class - Correct CZ generator comment (I-X → I-Z) - Expand set_sites docstrings in two-qubit gates to describe full effect - Add missing aliases to GateLibrary Attributes section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ruff RUF002 flags U+00D7 (×) as ambiguous. Replace d×d and d²×d² with dxd and (d^2)x(d^2) in Destroy, Create, and Crosstalk docstrings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New tests cover: - BaseGate: non-power-of-local_dim ValueError, list-input set_sites, @ operator, factory classmethods (destroy, zero, crosstalk, p0, p1, pvm) - mpo_tensors property AttributeError before set_sites is called - Zero, XX, YY, ZZ, P0, P1, PVM gate constructors - Crosstalk: matrix/swapped_matrix, mismatched-local_dim ValueError, all 13 named subclasses - Two-qubit gates (cx, cz, swap, rxx, ryy, rzz, cp): list-input set_sites, wrong-site-count ValueError, CX reversed-order tensor transpose - Entropy/SchmidtSpectrum set_sites list-input branch Remaining 3% (lines 99-114) is dead code in extend_gate's elif len(tensors) == 3 branch, which split_tensor never triggers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…00%) Three new tests target the three previously uncovered branches: - Adjacent two-site non-Crosstalk gate uses name_op.matrix directly (line 113) - Non-adjacent non-Crosstalk process with pre-supplied factors passes assert (line 120) - get_operator returns a BaseGate instance unchanged when passed directly (line 213) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers project overview, source layout, key abstractions (BaseGate, NoiseModel, MPS/MPO), development conventions, and useful commands. Complements AGENTS.md without duplicating it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace bare Any with Callable[..., BaseGate] and dict[str, list[float]] to satisfy ruff ANN401 (no bare Any) and ty call-non-callable checks - Move Callable import under TYPE_CHECKING per ruff TC003 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Annotations were dropped by a previous hook run. Reapply Callable[..., BaseGate] and dict[str, list[float]] for gate_factory and kwargs, with Callable imported under TYPE_CHECKING. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously CompactNoiseModel only accepted 1-site gates, where proc["sites"] was a flat list of ints. It now also accepts 2-site gates, where proc["sites"] is a list of [site_a, site_b] pairs. The expansion loop branches on gate_instance.interaction and delegates the resulting per-pair dicts to NoiseModel, which already handles adjacent (matrix) and long-range (factors) 2-site processes. Mixed 1-site and 2-site processes in the same model are supported. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the interaction-level branch with a single loop that detects whether each element of proc["sites"] is an int (1-site) or a list (2-site pair), eliminating duplicated append logic. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Noise characterization modules for the optimization of the decay rates in the Lindblad equation. The following gradient-free optimization methods are available: mcmc, cma, bayesian
Checklist: