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

Fixes for version 0.16.0 #73

Merged
merged 11 commits into from
Jun 15, 2021
Merged

Fixes for version 0.16.0 #73

merged 11 commits into from
Jun 15, 2021

Conversation

antalszava
Copy link
Contributor

@antalszava antalszava commented Jun 15, 2021

  • Fixes the expand_state method for the Wavefunction simulator device. Previously it always took the Kronecker product of the subsystems made up of the active wires followed by the subsystems of the inactive wires: |psi> ⊗ |0...0>. This, however, is incorrect in cases such as having 3 qubits, such that the middle qubit is inactive: |psiA> ⊗ |0> ⊗ |psiB> is not equal to|psiA>⊗ |psiB> ⊗ |0> .
  • Bumps the version number to prepare for the v0.16.0 release.

@antalszava antalszava requested a review from thisac June 15, 2021 16:29
Copy link
Contributor

@thisac thisac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix @antalszava. Just noticed that two of the tests have the same name and docstring, so I think the first one is never run. Otherwise it looks great!

Quite interesting to compare our different ways of solving the same way, see this _expand_state function. Just tested using that one here as well, as a comparison, and both pass your tests. 😄

CHANGELOG.md Outdated Show resolved Hide resolved
pennylane_forest/wavefunction.py Outdated Show resolved Hide resolved
tests/test_wavefunction.py Outdated Show resolved Hide resolved
@antalszava antalszava requested a review from thisac June 15, 2021 18:52
@antalszava
Copy link
Contributor Author

Thanks for the catch @thisac! Should be updated now. Hmm, maybe that could mean that we could consider a standardized QubitDevice method for expanding the state, though maybe good to also have more devices require this feature before doing that. 🤔

Copy link
Contributor

@thisac thisac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @antalszava! 💯

maybe that could mean that we could consider a standardized QubitDevice method for expanding the state

Could be a nice thing to keep in mind at least. I agree!

@antalszava antalszava merged commit 4b1c899 into master Jun 15, 2021
@antalszava antalszava deleted the fix_qubit_expand branch June 15, 2021 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants