-
Notifications
You must be signed in to change notification settings - Fork 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
Typescript development in Cirq and prototype bloch sphere implementation #4171
Conversation
OK, one last push:
|
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.
LGTM % some nits and the radius unit issue which you could punt to an issue. Deferring to @balopat for final approval.
|
||
/** | ||
* Class constructor | ||
* @param radius the desired radius of the sphere |
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.
IIUC, the size of the sphere could be radius 1, but will be various sizes on the screen depending on the distance of the camera. In the DOM, it's common to align on 'pixels' as the absolute unit of distance on the screen, and I think that makes sense for the radius here. WDYT?
Here is a case of someone trying to align pixels with the three.js world space.
@balopat - do you have any preference whether this gets punted to a new issue vs completed now?
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.
LGTM with some final tiny nits
Automerge cancelled: No approved review. |
Automerge cancelled: No approved review. |
I think the automerge bot might be dying on this PR due to its size :) |
Automerge cancelled: No approved review. |
### 3D circuit visualization This PR implements the features discussed in the [3D Quantum Circuits RFC](https://docs.google.com/document/d/1dLKj8oAF_JhDWU4zLU7XMz3aBXymd0hk_9n6U0mEtms/edit?usp=sharing). #### Relevant Issues and PRs #1075 - 3D diagrams for circuits #4171 - Typescript development in Cirq and prototype bloch sphere implementation #### Features implemented - All features of a [Cirq Typescript widget](#4171) - End to end display of circuits - Serialization of cirq.Circuit objects, re-representation in Typescript - Support for arbitrary length gates - Testing for the different components - A short jupyter notebook example https://user-images.githubusercontent.com/17647506/126213608-0c2d09d1-d5c2-4fa0-a8ae-3f0780f09912.mp4
…ion (quantumlib#4171) Typescript development in Cirq and prototype Bloch sphere implementation. ### Typescript Development in Cirq This PR implements the features discussed in the [Typescript Development in Cirq RFC](https://docs.google.com/document/d/16LybO9bNqL3LaIy1pZCJQXSPvKs5g3IqKkkE3efqM8U/edit). #### Listed below are the features included in the PR: - Infrastructure and directory structure to allow Typescript development in Cirq, including: - Bundling Typescript into Javascript, and examples of how to use these bundles - Hot reloading development environment for both browser and notebook settings - Typescript testing framework using Mocha and Chai, including a test for the bloch sphere. - Coverage checks for Typescript unit tests. (100% coverage needed in CI) - End-to-end integration between the Python and Javascript (the bloch sphere) - Example of full coverage testing of the Python side - CI for the Typescript environment for testing and linting. - Check scripts for testing and linting - An example 3d bloch sphere implementation. This bloch sphere can be viewed: - In the browser (development) - In a Jupyter notebook (development and production) - Via a generated HTML file. This file can be sent anywhere and be viewed in the browser, regardless of if the recipient has Cirq installed or not. - A [up-to-date package on Test PyPI](https://test.pypi.org/project/cirq-web/0.12.0.dev20210616161134/) representing the state of the cirq-web package as of 6/16/21. - Documentation for using cirq-web in the README files. ![colab_web_pr_trial](https://user-images.githubusercontent.com/17647506/122309538-1673ab80-ced4-11eb-96dd-112ea46b6df9.gif)
…#4334) ### 3D circuit visualization This PR implements the features discussed in the [3D Quantum Circuits RFC](https://docs.google.com/document/d/1dLKj8oAF_JhDWU4zLU7XMz3aBXymd0hk_9n6U0mEtms/edit?usp=sharing). #### Relevant Issues and PRs quantumlib#1075 - 3D diagrams for circuits quantumlib#4171 - Typescript development in Cirq and prototype bloch sphere implementation #### Features implemented - All features of a [Cirq Typescript widget](quantumlib#4171) - End to end display of circuits - Serialization of cirq.Circuit objects, re-representation in Typescript - Support for arbitrary length gates - Testing for the different components - A short jupyter notebook example https://user-images.githubusercontent.com/17647506/126213608-0c2d09d1-d5c2-4fa0-a8ae-3f0780f09912.mp4
Typescript Development in Cirq
This PR implements the features discussed in the Typescript Development in Cirq RFC.
Listed below are the features included in the PR: