-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix default wire mapping and QPU program compilation and add support for parallel execution #124
Fix default wire mapping and QPU program compilation and add support for parallel execution #124
Conversation
@AlbertMitjans Can you take a look at this? Thanks! 😄 |
qubits as numbers or strings (i.e., ``['q1', ..., 'qN']``). | ||
The number of labels must match the number of qubits accessible on the backend. | ||
If not provided, qubits are addressed as consecutive integers ``[0, 1, ...]``, and their number | ||
is inferred from the backend. | ||
If not provided, qubits are addressed by the backend. |
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.
To make sure I understand, does this mean that the user can pass any wires and they'll be mapped to the device wires, or that the user must use the appropriate wires for the device?
Per offline discussion, closing this in favorite of separate PRs for the wire mapping fix and the parallel processing improvement. |
This addresses #123 in a 3 ways:
By default, we were using
[0, n)
as the wire numbers for an n-qubit device, but qubits on a real QPU aren't always addressed in this way. Instead, we letpyQuil
tell us what the qubits on the device are and build the wire map from that. By default, the user wire labels will map to a device wire label 1-to-1, that way users who want to address them, can do so using the values directly from the our QPU topology metrics and diagrams.Measurements will now use the wire mapping to generate
MEASURE
statements for every Qubit to readout instead of assuming[0, n)
. Like (1), this is important for real QPUs, which don't always address qubits sequentially.protoquil
for program compilation targeting QPUsBy default a program compiled by
quilc
will use the fullquil
spec to generate nativequil
. However, not everything in thequil
spec is supported by our QPUs, soquilc
also supports building a program usingprotoquil
, a subset ofquil
that is compatible with a QPU.Our QPU devices now set the
protoquil
flag when compiling to avoid generating a program that might not run on a real QPU.This also adds support for parallel execution using threadpools to run jobs in parallel. This works for both the QVM and QPU device and can greatly improve execution speed.