fix: 🐛 Fix the Substate Vector Problem#16
Merged
Conversation
Now, we check if a given substate is separable, and if it is, we trace out unwanted qubits instead of performing a projection
…trixXcd` missing direct header instead
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #16 +/- ##
=======================================
+ Coverage 93.2% 93.6% +0.3%
=======================================
Files 9 9
Lines 1247 1363 +116
Branches 194 226 +32
=======================================
+ Hits 1163 1276 +113
- Misses 84 87 +3
|
This file contains hidden or 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
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.
Description
This pull request resolves the currently biggest underlying issue: The generation of substate vectors. At the moment, substate vectors are computed by projecting the full state vector onto a subset of its qubits. While this is a valid approach in general, the resulting vector is not guaranteed to be a valid state vector. Due to destructive interference, it may not be normalised or a 0-vector, which is not compatible with many use cases.
Furthermore, all assertion types are currently implemented using substate vectors. For instance, for the superposition assertion, we first compute a substate vector containing only the target qubits and then we perform our calculation. Because of that, this bug spreads over a large part of the code base.
To resolve this, this pull request brings the following changes:
Fixes # (issue)
Checklist: