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

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

Open
NoureldinYosri opened this issue May 20, 2024 · 11 comments
Assignees
Labels
good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. kind/bug-report Something doesn't seem to work. no QC knowledge needed Want to contribute to Cirq, but don't know quantum computing? This issue is for you. triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add

Comments

@NoureldinYosri
Copy link
Collaborator

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

@NoureldinYosri NoureldinYosri added the kind/bug-report Something doesn't seem to work. label May 20, 2024
@NoureldinYosri NoureldinYosri added good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. no QC knowledge needed Want to contribute to Cirq, but don't know quantum computing? This issue is for you. triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add labels May 22, 2024
@shef4
Copy link
Contributor

shef4 commented Jun 12, 2024

Hi, I'm interested in taking on this issue. Will look more into the current implementation.

@NoureldinYosri
Copy link
Collaborator Author

@shef4 thanks for offering to help

@shef4 shef4 removed their assignment Aug 12, 2024
@shef4
Copy link
Contributor

shef4 commented Aug 12, 2024

Hi @NoureldinYosri , please assign this issue to another developer. Thank you for learning opportunity. The cirq meetings are a great place for students to learn about real world development practices and I hope they continue to help new and experienced developers grow and learn.

@nivedha1
Copy link

Hi @NoureldinYosri Can i take this up

@NoureldinYosri
Copy link
Collaborator Author

@nivedha1 sure, thanks for offering to help

@nivedha1
Copy link

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!

@shef4
Copy link
Contributor

shef4 commented Aug 13, 2024

Hi @nivedha1, from the comment made about this issue #6607 (comment) by cosenal

And in fact, CNOT (CXPowGate) doesn't even show up in the list from noise_props.expected_gates() 🤔

you might need you use this function to check which gates are supported by the device noise_props.expected_gates()

@shef4
Copy link
Contributor

shef4 commented Aug 13, 2024

Honestly, I'm not sure.

  1. I would assume the user selects the device they'd want to run the circuit on so it might be an input parameter that related to a specific processor ID.
  2. If not Cirq might take advantage of a load balancer to decide which processor to use - in that case it might be an inherited variable from a parent class or stored in a database that gets called from at runtime.

@NoureldinYosri would need to shed more light on the matter.

Hope this helps!

@nivedha1
Copy link

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

@shef4
Copy link
Contributor

shef4 commented Aug 13, 2024

Hi @nivedha1,

Honestly not sure, but this is a good question to bring up in the Cirq bi-weekly meetings

@NoureldinYosri
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. kind/bug-report Something doesn't seem to work. no QC knowledge needed Want to contribute to Cirq, but don't know quantum computing? This issue is for you. triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add
Projects
None yet
Development

No branches or pull requests

3 participants