-
Notifications
You must be signed in to change notification settings - Fork 646
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
[Prototype] Add mini.qubit
for testing and reference
#5445
Conversation
Hello. You may have forgotten to update the changelog!
|
|
||
""" | ||
|
||
name = "mini.qubit" |
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.
Minor comment, but if you want to name it reference.qubit
, it will help enforce that it is a reference device for future developers, and minimize users finding/using it :)
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.
@albi3ro any concerns with calling it reference.qubit
? I also like reference
more than mini
- which could sound like it's for small scale simulations.
Args: | ||
wires (int, Iterable[Number, str]): Number of wires present on the device, or iterable that | ||
contains unique labels for the wires as numbers (i.e., ``[-1, 0, 2]``) or strings | ||
(``['ancilla', 'q1', 'q2']``). Default ``None`` if not specified. While this device allows |
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.
(``['ancilla', 'q1', 'q2']``). Default ``None`` if not specified. While this device allows | |
(``['auxiliary', 'q1', 'q2']``). Default ``None`` if not specified. While this device allows |
How shall we proceed with this PR? Is this something that could be put in the Q3 technical roadmap? |
I would 100% say this is something we should add at some point in the future, when we have time. Both because it allows us to have much more robust testing, and because it forms a useful jumping off spot for device developers. Q3 technical roadmap might be a good spot. |
Nice! Looks like [SC-65558] is the story. |
name="mini.qubit", | ||
) | ||
program.add_transform( | ||
diagonalize_measurements, stopping_condition=supports_operation, name="mini.qubit" |
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.
diagonalize_measurements, stopping_condition=supports_operation, name="mini.qubit" | |
diagonalize_measurements, supported_base_obs=(qml.Z,), name="mini.qubit" |
if tape.shots: | ||
samples = sample_state(state, shots=tape.shots.total_shots, seed=seed) | ||
results = tuple(mp.process_samples(samples, tape.wires) for mp in tape.measurements) |
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.
Do we need to add shot vector support here?
|
||
|
||
@transform | ||
def split_up_non_commuting(tape): |
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 can probably remove this now.
Completed by #6181 |
Context:
This exploration can potentially solve two issues:
Providing a stripped-down reference for plugin developers, helping distinguish between what is required for a device, and the extra features that
default.qubit
provides. Many of the performance optimizations and bonus features available indefault.qubit
are not necessary for plugins, and make the source code more difficult to get through.Allowing testing on a feature-less device. Sometimes code will work on
default.qubit
, but not any other device becausedefault.qubit
has features that normal plugins do not. By testing withmini.qubit
, we haveDescription of the Change:
There are two main parts to this draft:
mini.qubit
devicemini.qubit
Work from two other branches are included:
fix_vmap
andnon-commuting-expanding-fixes
.Benefits:
Possible Drawbacks:
Related GitHub Issues: