-
Notifications
You must be signed in to change notification settings - Fork 615
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
Integration into the current PL device ecosys #6684
Open
JerryChen97
wants to merge
314
commits into
master
Choose a base branch
from
add-qubit_mixed/integration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Astral Cai <[email protected]>
…neAI/pennylane into add-qubit_mixed/sampling
…o add-qubit_mixed/integration
JerryChen97
added
the
do not merge ⚠️
Do not merge the pull request until this label is removed
label
Jan 3, 2025
Let's merge this after the v0.40 release is live |
mudit2812
reviewed
Jan 3, 2025
Comment on lines
+730
to
+732
# Validate Hermiticity | ||
if not math.allclose(density_matrix, math.conjugate(math.transpose(density_matrix))): | ||
raise ValueError("Density matrix must be Hermitian.") |
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.
Sorry for missing this earlier, but this seems like a check that should be performed in the initialization of QubitDensityMatrix
rather than here.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context:
We finished all the necessary components of the new API interface of
default_mixed
. However, since this is an internal change, which involves many different files and paths, we would like to have one more round of check, success and merge of which should concludes the whole epic.Description of the Change:
keep DefaultMixed, but rename it to DefaultMixedLegacy (note: still the legacy one will be purged before this PR merged into master; it's kept right now due to great help in debug)operations_mixed
back tooperations
, and copy it to DefaultMixedLegacyreadout_error
just aswith arbitrary input error channelsBitFlip
modify all the device tests inDeleted legacy specified device tests. These should be covered in the integration test suite mentioned abovetests/devices
accordingly. Basically thetests/devices/test_default_mixed*.py
if no errors come up, then separate the legacy code into another fileLots of errors, see drawback section for a record along with updates.test_return_types_qnode
default.mixed
dev._state
needs to be removed and may be replaced by equivalent or not. Sol: had a PR to improve this linepip install git+https://github.com/PennyLaneAI/pennylane-qiskit.git@master
)why user warning here? Didn't read like sensible. Should double check.when running on notebook everything is finesome by-the-way improvement:
get_canonical_interface_name
and removed the hardcoded dictionary mimic of enum.qubit_mixed
much more withqubit
moduleBenefits:
Legacy code was preserved for reference purpose as well as catering for potential usersBetter separation between new interface and legacydefault.mixed
is ported directly with our new API.Possible Drawbacks:
default_mixed
might find it annoying for a while. However, we would include a direct indication in changelog as well as the new class.unexpected bug 1:finite-diff
support forPurityMP
on torch, tf, and jax downunexpected bug 2: gradient calculation atPhaseFlip(0)
breaks withnan
returned at initial state |0> (all good for other other channels or other state with PhaseFlip`expected bug 3: classical shadow is down for most of tests. This is due to the fact that the implementation is hidden insideQubitDevice
which was missed out before. Need to be fixed asapRelated GitHub Issues:
[sc-73324]