-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update getting started notebook #5046
Conversation
maffoo
commented
Mar 1, 2022
- Use Circuit.transform_qubits instead of cg.optimize_for_sycamore, since all we need to do is change qubits.
- Don't specify a gate_set, which will use CircuitSerializer by default.
- Use standard string representation of cirq.Result.
- Remove unused imports.
- Use Circuit.transform_qubits instead of cg.optimize_for_sycamore. - Don't specify a gate_set, which will use CircuitSerializer by default. - Use standard string representation of cirq.Result. - Remove unused imports.
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
lgtm. Will leave approval to someone more familiar with transformers |
"# Transform circuit to use an available hardware qubit.\n", | ||
"hw_circuit = circuit.transform_qubits(lambda q: valid_qubit)\n", |
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.
While I agree with not using optimize_for_gateset
since it breaks WYSIWYG, I worry that removing gateset considerations entirely from this tutorial will leave readers stranded as soon as they attempt something outside the HW gateset.
CC @tanujkhattar to recommend a WYSIWYG-friendly transformer for this, if one exists.
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.
Instead of using a transformer, we could point them to further documentation for non-native gates. Either here or in the "Next steps" section at the end.
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.
We currently have a next step "Explore best practices for getting circuits to run on hardware." That seems like it would be a natural places to talk about transformers that can compiler to native gates. It currently talks about validation and optimized_for_sycamore
, so this would need to be updated to reflect recent development.
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.
+1 to Matthew's recommendation - if we update that doc to cover this detail (here or in a follow-up), I'd be happy to sign off on the changes here.
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.
I updated the test to talk about transform_qubits
instead of optimized_for_sycamore
and added a note about transforming to available gates with a link to the best practices guide. I couldn't see any guides about transformers or compilation target gatesets, but once we have something we can link to that instead.
- Use Circuit.transform_qubits instead of cg.optimize_for_sycamore, since all we need to do is change qubits. - Don't specify a gate_set, which will use CircuitSerializer by default. - Use standard string representation of cirq.Result. - Remove unused imports.