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

[runtime] QubitPlacer #4678

Closed

Conversation

mpharrigan
Copy link
Collaborator

@mpharrigan mpharrigan commented Nov 13, 2021

This PR defines a QubitPlacer abstract interface, some example concrete implementations, hooks into cg.workflow.execute to plumb in the new interface, and shims highlighting some of the blockers.

Including qubit placement as part of the quantum runtime is important for our benchmarking / data science requirements.

  • We want fixed (frozen, immutable) executable: “the loschmidt echo benchmark”.
  • Picking qubits is how you run, not what you run.
  • Devices change, qubits change. We want to compare.

In order of increasing sophistication, I want to support the following strategies for qubit placement

  1. Fallback: use circuit qubits: NaiveQubitPlacer
  2. Explicit, by hand, per {topology x device}: HardcodedQubitPlacer
  3. Random subgraph monomorphism: RandomDevicePlacer
  4. Do a characterization to guide placement (not in this PR)

Please take a look at this sketch of the interface and the example concrete implementations given the above list. Please raise any structural or naming concerns now. I'll split up into a PR for the interface and runtime execute hooks, then one for each strategy.

You can see that there are several device-related blockers in this

  1. I need a method to get a networkx graph from a device
  2. Devices should be json serializable so we can record them in our SharedRuntimeInformation.
  3. Devices should support __eq__ equality testing.

cc @MichaelBroughton @dstrain115 @tanujkhattar @dabacon

@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Nov 13, 2021
@CirqBot CirqBot added the size: L 250< lines changed <1000 label Nov 13, 2021
@tanujkhattar tanujkhattar self-assigned this Nov 17, 2021
@mpharrigan mpharrigan force-pushed the 2021-11-qubit-placement branch from fcb03ac to a2b8597 Compare November 23, 2021 00:03
@mpharrigan mpharrigan force-pushed the 2021-11-qubit-placement branch from a2b8597 to c72ad32 Compare December 2, 2021 00:25
CirqBot pushed a commit that referenced this pull request Dec 2, 2021
Splitting up #4678 

- The interface: `QubitPlacer`
- The fallback: `NaiveQubitPlacer`
- runtime hooks

some hacks around #4699
@mpharrigan
Copy link
Collaborator Author

mpharrigan commented May 16, 2022

This has been merged as part of #5194 #4701 #4700 #4719

@mpharrigan mpharrigan closed this May 16, 2022
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Splitting up quantumlib#4678 

- The interface: `QubitPlacer`
- The fallback: `NaiveQubitPlacer`
- runtime hooks

some hacks around quantumlib#4699
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/google/placement area/workflow cla: yes Makes googlebot stop complaining. size: L 250< lines changed <1000
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants