-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat] Added simulated readout error routines #23
Conversation
Add constructors
Digital decomposition, operations and Braket backend
add utils.py file
* Add README. * Remove useless heading.
Co-authored-by: Kaonan Micadei <[email protected]> Co-authored-by: Vytautas Abramavicius <[email protected]>
* state preparation * logging * register * execution helpers * qubit support * serialization * typing * wavefunction overlaps Co-authored-by: Aleksander Wennersteen <[email protected]> Co-authored-by: Mario Dagrada <[email protected]> Co-authored-by: Vincent Elfving <[email protected]> Co-authored-by: Dominik Seitz <[email protected]> Co-authored-by: Joao Moutinho <[email protected]> Co-authored-by: Vytautas Abramavicius <[email protected]> Co-authored-by: Niklas Heim <[email protected]> Co-authored-by: Roland Guichard <[email protected]>
* state preparation * logging * register * execution helpers * qubit support * serialization * typing * wavefunction overlaps Co-authored-by: Aleksander Wennersteen <[email protected]> Co-authored-by: Mario Dagrada <[email protected]> Co-authored-by: Vincent Elfving <[email protected]> Co-authored-by: Dominik Seitz <[email protected]> Co-authored-by: Joao Moutinho <[email protected]> Co-authored-by: Vytautas Abramavicius <[email protected]> Co-authored-by: Niklas Heim <[email protected]> Co-authored-by: Roland Guichard <[email protected]>
Co-authored-by: Aleksander Wennersteen <[email protected]> Co-authored-by: Mario Dagrada <[email protected]> Co-authored-by: Vincent Elfving <[email protected]> Co-authored-by: Gert-Jan Both <[email protected]>
* Docs suggestions. * Fix typo. * Latest changes. * Latest changes. * Trigger docs tests on CI. * More files to docs. * fix circuit drawings * quadance to qadance * More docs improvements. * fix docs build * More suggestions and run test-docs again. * update pulser examples * remove mkdocs-jupyter * update pulser example * More improvements. --------- Co-authored-by: jpmoutinho <[email protected]> Co-authored-by: João P. Moutinho <[email protected]> Co-authored-by: Vytautas Abramavicius <[email protected]>
* update readme * remove admonition * lint --------- Co-authored-by: Roland Guichard <[email protected]>
* Improvements to the Pulser backend documents + change defaults * Shorter names to the workflows * Linting * Improvements to the docs * Added AnalogRZ operation to the enumeration * Go back to idealized device --------- Co-authored-by: Roland Guichard <[email protected]>
Co-authored-by: Aleksander Wennersteen <[email protected]>
Co-authored-by: Aleksander Wennersteen <[email protected]> Co-authored-by: Mario Dagrada <[email protected]>
* Docs suggestions. * Fix typo. * Latest changes. * Latest changes. * Trigger docs tests on CI. * More files to docs. * fix circuit drawings * quadance to qadance * More docs improvements. * fix docs build * More suggestions and run test-docs again. * update pulser examples * remove mkdocs-jupyter * update pulser example * More improvements. * Fix lint. * More docs suggestions. * More and more suggestions. * More suggestions. * More suggestions. * Concatenate two doc files. * Move to qml_tools.md * More suggestions. * update entanglement tests * few fixes * pulser-basic tutorial broken * few fixes * few fixes * more fixes * remove total_magnetization from docs * remove emuc * fix entanglement test * fix entanglement test * Update docs/advanced_tutorials/custom-models.md * Update docs/advanced_tutorials/differentiability.md * Update docs/digital_analog_qc/pulser-basic.md * Update docs/tutorials/ml_tools.md * Update docs/tutorials/qml_tools.md * Update docs/tutorials/ml_tools.md * Update docs/tutorials/qml_tools.md * Update docs/tutorials/serializ_and_prep.md * More suggestions. * Fix conflicts. --------- Co-authored-by: jpmoutinho <[email protected]> Co-authored-by: João P. Moutinho <[email protected]> Co-authored-by: Vytautas Abramavicius <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @madagra. Here are some uncomplete suggestions. If you approve them, I'll take this work over.
qadence/backend.py
Outdated
@abstractmethod | ||
def _overlap(bras: Tensor, kets: Tensor) -> Tensor: | ||
def overlap(self, bra: QuantumCircuit, ket: Optional[QuantumCircuit] = None) -> Tensor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def overlap(self, bra: QuantumCircuit, ket: Optional[QuantumCircuit] = None) -> Tensor: | |
def overlap(self, bra: QuantumCircuit, ket: QuantumCircuit | None = None) -> Tensor: |
@@ -49,6 +50,7 @@ def __init__( | |||
diff_mode: DiffMode = DiffMode.AD, | |||
protocol: Measurements | None = None, | |||
configuration: BackendConfiguration | dict | None = None, | |||
noise_model: ErrorModel | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noise_model: ErrorModel | None = None, | |
error_model: ErrorModel | None = None, |
@@ -62,6 +64,7 @@ def __init__( | |||
protocol: Optional measurement protocol. If None, use | |||
exact expectation value with a statevector simulator. | |||
configuration: Configuration for the backend. | |||
noise_model: Whether or not and which noise model to use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noise_model: Whether or not and which noise model to use. | |
error_model: Whether or not and which noise model to use. |
@@ -93,6 +95,8 @@ def __init__( | |||
self._backend_name = backend | |||
self._diff_mode = diff_mode | |||
self._protocol = protocol | |||
self._noise_model = noise_model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._noise_model = noise_model | |
self._error_model = error_model |
if self._noise_model is None: | ||
return output | ||
# corrupt bitstrings with simple readout noise | ||
elif self._noise_model.name == "ReadoutError": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the point: readout errors aren't generated by noise. I think naming everything error_model
makes it more generic.
qadence/noise.py
Outdated
"""White noise distributions""" | ||
|
||
UNIFORM = staticmethod(uniform.Uniform(low=0.0, high=1.0)) | ||
"uniform white noise" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"uniform white noise" | |
"""Uniform white noise.""" |
qadence/noise.py
Outdated
"uniform white noise" | ||
|
||
GAUSSIAN = staticmethod(normal.Normal(loc=0.0, scale=1.0)) | ||
"gaussian white noise" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"gaussian white noise" | |
"""Gaussian white noise.""" |
qadence/noise.py
Outdated
"gaussian white noise" | ||
|
||
POISSON = staticmethod(poisson.Poisson(rate=0.1)) | ||
"poisson white noise" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"poisson white noise" | |
"""Poisson white noise.""" |
qadence/noise.py
Outdated
name = "ErrorModel" | ||
|
||
@abstractmethod | ||
def bit_flip(self, qbit: int) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def bit_flip(self, qbit: int) -> int: | |
def bit_flip(self, qubit: int) -> int: |
qadence/noise.py
Outdated
pass | ||
|
||
@abstractmethod | ||
def phase_flip(self, qbit: int) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def phase_flip(self, qbit: int) -> int: | |
def phase_flip(self, qubit: int) -> int: |
@Roland-djee please close this one. |
Deprecated. This will be closed soon.