Skip to content

NoiseModelFromGoogleNoiseProperties should raise an error when simulations use qubits not on the device or an uncompiled circuit #6608

Description

@NoureldinYosri

Description of the issue
Noisy Simulation describes how to run simulations with realistic noise obtained from a real quantum device. however when using that noise model with a gate that is not native to the device the simulation, no noise gets added (e.g. #6607 (comment)). another issue is that when the circtuit uses qubits not on the device a key error is raised with little information explaining why that is.

Proposed Solution
Before (or while) running the simulation validate that the qubits and gets in the circuit uses supported qubits and gates.

How to reproduce the issue
#6607

Cirq version
1.4.0.dev20240419073809

Activity

  1. added
    kind/bug-reportSomething doesn't seem to work.
    good first issueThis issue can be resolved by someone who is not familiar with the codebase. A good starting issue.
    no QC knowledge neededWant to contribute to Cirq, but don't know quantum computing? This issue is for you.
    triage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked on
    on May 20, 2024
  2. NoureldinYosri commented on Jun 12, 2024

    @NoureldinYosri
    CollaboratorAuthor

    @shef4 thanks for offering to help

  3. Repository owner unassigned on Aug 12, 2024
  4. nivedha1 commented on Aug 12, 2024

    @nivedha1

    Hi @NoureldinYosri Can i take this up

  5. NoureldinYosri commented on Aug 13, 2024

    @NoureldinYosri
    CollaboratorAuthor

    @nivedha1 sure, thanks for offering to help

  6. nivedha1 commented on Aug 13, 2024

    @nivedha1

    Hi @NoureldinYosri

    I was able to implement the first part of the problem "To raise an error when trying to run simulations with qubits not on the device"

    But for "A circuit not compiled to a supported gateset" part,

    Im unable to figure out a way to get the target gateset from the compiled gateset to check if it is part of supported gateset.

    Please Advise

    Thanks!

  7. nivedha1 commented on Aug 13, 2024

    @nivedha1

    @shef4
    One follow up question
    How to find the processor id for the underlying quantum device
    Thanks!

  8. NoureldinYosri commented on Aug 13, 2024

    @NoureldinYosri
    CollaboratorAuthor

    Hi, please check #6607 (comment) for the methods that you will need ... namely noise_props.qubits for qubits and noise_props.expected_gates() for gates. you don't need to worry about processor_id or anything related to the hardware.

    This issue isn't about talking to the actualy hardware but about fixing a simulation that tries to mimic the hardware... the mimicing of the hardware happens through the noise model. this issue is about validating that the circuit is consistent with the noise model.

  9. Acciaccatura commented on Feb 19, 2026

    @Acciaccatura
    Contributor

    Hello! Is this issue active? Can I take a look at this?

  10. mhucka commented on Apr 21, 2026

    @mhucka
    Contributor

    @nivedha1 Thank you for your interest in Cirq. For planning purposes, could you let us know if you are still working on this issue, or planning to?

  11. mhucka commented on May 1, 2026

    @mhucka
    Contributor

    @Acciaccatura Thank you for your interest. I've reassigned this to you.

  12. Acciaccatura commented on May 6, 2026

    @Acciaccatura
    Contributor

    hi! so it seems like looking into the cosebase:

    • SimulatorBase produces simulations based on a given noise model, and it injects noise into simulations during run() and simulate() (specifically via _core_iterator()) so this would probably be the best place to check for compatability with circuit hardware?
    • also, I think NoiseProperties is the interface for developers to abstract hardware specifications into a noise model (resulting in NoiseModelFromNoiseProperties).
    • so, I think we would need to expose property information up through the noise model so that the simulator has access to it, and perform a check in SimulatorBase._core_iterator() to see if the noise model provided supports the desired gates/qubits. so something like:
    def _core_iterator(self, circuit: cirq.AbstractCircuit):
      ...
      if isinstance(self.noise, cirq.NoiseModelFromNoiseProperties)`):
        # <do the checks here and raise necessary exceptions>
      .. 
      # the rest of the logic

    if that all seems correct, I'll go ahead and start implementation :)

  13. matti-sarjala commented on May 14, 2026

    @matti-sarjala

    A small scoping point that might help the implementation/review:

    It may be useful to keep the validation focused on compatibility with the noise model, not compatibility with a live processor.

    Possible minimal behavior:

    1. If a circuit uses qubits outside noise_props.qubits, raise a clear error listing the unsupported qubits.
    2. If a circuit uses operations whose gate type is not represented in noise_props.expected_gates(), raise a clear error listing the unsupported operation types.
    3. Make the error message explain that the circuit should be compiled / transformed to the device-compatible gateset before using this realistic noise model.
    4. Add separate tests for:
      • unsupported qubit,
      • unsupported gate,
      • valid compiled circuit does not raise.

    This would avoid tying the fix to processor IDs or live hardware access, and would keep the behavior centered on the information already present in the noise properties.

  14. added
    help wantedContributions welcome!
    and removed
    help wantedContributions welcome!
    on Jun 1, 2026
  15. Acciaccatura commented on Jun 12, 2026

    @Acciaccatura
    Contributor

    sorry for the radio silence - was really busy this past month! i'm going to go ahead and send a PR out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueThis issue can be resolved by someone who is not familiar with the codebase. A good starting issue.kind/bug-reportSomething doesn't seem to work.no QC knowledge neededWant to contribute to Cirq, but don't know quantum computing? This issue is for you.triage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked on

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions