Skip to content
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

Approximate hardware noise in Cirq #4640

Closed

Conversation

95-martin-orion
Copy link
Collaborator

This is the umbrella PR for realizing an approximation of Google hardware noise in Cirq. Smaller PRs will be opened to roll out the change gradually and reduce reviewer load; this PR exists to provide context for those PRs.

This change addresses #3429 and implements the design outlined in internal "realistic Cirq noise" documentation.

@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Nov 9, 2021
@CirqBot CirqBot added the size: XL lines changed >1000 label Nov 9, 2021
@95-martin-orion 95-martin-orion marked this pull request as draft November 9, 2021 00:25
CirqBot pushed a commit that referenced this pull request Nov 23, 2021
Prior to this PR, Cirq supported serialization of _instances_ of Cirq types, but not the types themselves. This PR adds serialization support for Cirq types, with the format:
```
{
    'cirq_type': 'type',
    'typename': $NAME
}
```
where `$NAME` is the `cirq_type` of the object in its JSON representation. For type T, `$NAME` is usually `T.__name__`, but some types (mostly in `cirq_google`) do not follow this rule. The `json_cirq_type` protocol and `_json_cirq_type_` magic method are provided to handle this.

It is worth noting that this PR explicitly **does not** support serialization of non-Cirq types (e.g. python builtins, sympy and numpy objects) despite instances of these objects being serializable in Cirq. This support can be added to `json_cirq_type` and `_cirq_object_hook` in `json_serialization.py` if we decide it is necessary; I left it out of this PR as it is not required by the motivating changes behind this PR (#4640 and sub-PRs).
CirqBot pushed a commit that referenced this pull request Dec 14, 2021
This PR is part of #4640. It adds the `InsertionNoiseModel`, which injects noise based on a user-defined map.

#4671 is a prerequisite for this PR. The only files that need to be reviewed in this PR are:

- `cirq-core/cirq/devices/...`
    - `__init__.py`
    - `insertion_noise_model[_test].py`
MichaelBroughton pushed a commit to MichaelBroughton/Cirq that referenced this pull request Jan 22, 2022
This PR is part of quantumlib#4640. It adds the `InsertionNoiseModel`, which injects noise based on a user-defined map.

quantumlib#4671 is a prerequisite for this PR. The only files that need to be reviewed in this PR are:

- `cirq-core/cirq/devices/...`
    - `__init__.py`
    - `insertion_noise_model[_test].py`
@95-martin-orion
Copy link
Collaborator Author

Closing as all related sub-PRs have been merged.

rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Prior to this PR, Cirq supported serialization of _instances_ of Cirq types, but not the types themselves. This PR adds serialization support for Cirq types, with the format:
```
{
    'cirq_type': 'type',
    'typename': $NAME
}
```
where `$NAME` is the `cirq_type` of the object in its JSON representation. For type T, `$NAME` is usually `T.__name__`, but some types (mostly in `cirq_google`) do not follow this rule. The `json_cirq_type` protocol and `_json_cirq_type_` magic method are provided to handle this.

It is worth noting that this PR explicitly **does not** support serialization of non-Cirq types (e.g. python builtins, sympy and numpy objects) despite instances of these objects being serializable in Cirq. This support can be added to `json_cirq_type` and `_cirq_object_hook` in `json_serialization.py` if we decide it is necessary; I left it out of this PR as it is not required by the motivating changes behind this PR (quantumlib#4640 and sub-PRs).
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
This PR is part of quantumlib#4640. It adds the `InsertionNoiseModel`, which injects noise based on a user-defined map.

quantumlib#4671 is a prerequisite for this PR. The only files that need to be reviewed in this PR are:

- `cirq-core/cirq/devices/...`
    - `__init__.py`
    - `insertion_noise_model[_test].py`
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
Prior to this PR, Cirq supported serialization of _instances_ of Cirq types, but not the types themselves. This PR adds serialization support for Cirq types, with the format:
```
{
    'cirq_type': 'type',
    'typename': $NAME
}
```
where `$NAME` is the `cirq_type` of the object in its JSON representation. For type T, `$NAME` is usually `T.__name__`, but some types (mostly in `cirq_google`) do not follow this rule. The `json_cirq_type` protocol and `_json_cirq_type_` magic method are provided to handle this.

It is worth noting that this PR explicitly **does not** support serialization of non-Cirq types (e.g. python builtins, sympy and numpy objects) despite instances of these objects being serializable in Cirq. This support can be added to `json_cirq_type` and `_cirq_object_hook` in `json_serialization.py` if we decide it is necessary; I left it out of this PR as it is not required by the motivating changes behind this PR (quantumlib#4640 and sub-PRs).
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
This PR is part of quantumlib#4640. It adds the `InsertionNoiseModel`, which injects noise based on a user-defined map.

quantumlib#4671 is a prerequisite for this PR. The only files that need to be reviewed in this PR are:

- `cirq-core/cirq/devices/...`
    - `__init__.py`
    - `insertion_noise_model[_test].py`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining. size: XL lines changed >1000
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants