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

Fock-basis backends: State preparations produce density matrices even when it's not necessary #26

Closed
smite opened this issue Jul 23, 2018 · 2 comments
Labels
backend enhancement New feature or request on hold

Comments

@smite
Copy link
Contributor

smite commented Jul 23, 2018

Preparing a pure state in a subsystem should not convert the entire state representation into a density matrix unless it is necessary. If the reduced state of the rest of the system is pure at the time of the preparation, the entire state remains pure.

Possibly related to #20

Issue description

  • Expected behavior: State representation remains a ket vector after Fock(1) is executed

  • Actual behavior: State representation changes into a density matrix

Also applies to other preparations.

Minimal example

import strawberryfields as sf
from strawberryfields.ops import *
    
if __name__ == '__main__':
    backend = 'fock'
    eng, q = sf.Engine(2)
    st = eng.run(backend, cutoff_dim=5)
    print(st)
    with eng:
        Fock(1) | 0
    st = eng.run(backend, cutoff_dim=5)
    print(st)
@smite smite added the enhancement New feature or request label Jul 23, 2018
@co9olguy
Copy link
Member

We are aware of this and plan to implement it in a future release. While it seems like a simple issue, it requires some caution with the implementation since we will have to track whether the mode(s) where the state is prepared are potentially entangled with other modes.

@thisac
Copy link
Contributor

thisac commented Jun 16, 2022

Closing this issue in favour of the more up-to-date #490 (further discussion in #488).

@thisac thisac closed this as completed Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request on hold
Projects
None yet
Development

No branches or pull requests

4 participants