Conversation
|
Hi @eshant742, thank you for the PR!
Sorry to ask you for extra effort. Let me know if there is anything unclear! |
|
yeah i am on it |
|
these were changes Added from .noise_model import * # noqa to graphqec/init.py so that NoiseModel and related classes are accessible without import errors. Replaced circuit.to_text_diagram() with str(circuit) because to_text_diagram() is only available in Stim’s development branch. Using str(circuit) works on the stable version of Stim, preventing the “no method ‘to_text_diagram’” error. |
| from graphqec.codes.base_code import BaseCode | ||
|
|
||
| # Import the NoiseModel interface (and possibly other models) if needed | ||
| from graphqec.noise_models import NoiseModel |
There was a problem hiding this comment.
The ending "s" is still in the import
| def __init__( | ||
| self, code: BaseCode, distances: list[int], error_rates: list[float] | ||
| self, | ||
| code: BaseCode, # or `type[BaseCode]` if `code` is a class, not an instance |
There was a problem hiding this comment.
Replace with type[BaseCode]
(Thank you for pointing it out!)
| import matplotlib.pyplot as plt | ||
| import pymatching | ||
|
|
||
| # If your code parameter is actually a class (subclass of BaseCode), |
| from .measurement import * # noqa | ||
| from .stab import * # noqa | ||
| from .lab import * # noqa | ||
| # graphqec/__init__.py |
| from graphqec.measurement import Measurement | ||
| from graphqec.stab import X_check, Z_check | ||
|
|
||
| # NEW: Import your NoiseModel and a default DepolarizingNoiseModel |
| @@ -1,3 +1,5 @@ | |||
| # graphqec/codes/base_code.py | |||
| "_graph", | ||
| "_checks", | ||
| "_logic_check", | ||
| "_noise_model", # NEW SLOT |
| distance: int = 3, | ||
| depolarize1_rate: float = 0, | ||
| depolarize2_rate: float = 0, | ||
| noise_model: NoiseModel = None, # NEW PARAM |
| self._checks: list[str] | ||
| self._logic_check: list[str] | ||
|
|
||
| self._checks: list[str] = [] |
There was a problem hiding this comment.
To be removed. It should be defined in the Child class
| self._logic_check: list[str] | ||
|
|
||
| self._checks: list[str] = [] | ||
| self._logic_check: list[str] = [] |
There was a problem hiding this comment.
To be removed. It should be defined in the Child class
|
There is an issue with the implementation. The threshold lab returns 0s on the collected data. For the following code: I get: we should expect non-zero values for non-zero error rates. Could you have a look? |
No description provided.