Skip to content

Fix bugs for Bosonic Homodyne measurement and marginal function#93

Merged
sansiro77 merged 1 commit intoTuringQ:mainfrom
Hugh-888:hotfix-bosonic
Apr 18, 2025
Merged

Fix bugs for Bosonic Homodyne measurement and marginal function#93
sansiro77 merged 1 commit intoTuringQ:mainfrom
Hugh-888:hotfix-bosonic

Conversation

@Hugh-888
Copy link
Collaborator

Fix bug for bosonic homodyne measurement and marginal function

  1. bosonic homodyne measurement
cir = dq.QumodeCircuit(nmode=2, init_state='vac', cutoff=3, backend='bosonic')
cir.cat(wires=0, r=1)
state = cir()
measure_re = cir.measure_homodyne(wires=[0,1], shots=100)
print(measure_re.shape)
  1. bosonic marginal function
cir = dq.QumodeCircuit(nmode=2, init_state='vac', cutoff=3, backend='bosonic')
cir.cat(wires=0, r=1)
state = cir()
s = dq.BosonicState(state, nmode=2)
qvec = torch.linspace(-5, 5, 200)
pvec = torch.linspace(-5, 5, 200)
marginal = s.marginal(wire=0, qvec=qvec, phi=0, plot=True)

@sansiro77 sansiro77 changed the title Fix bug for bosonic homodyne measurement and marginal function Fix bugs for Bosonic Homodyne measurement and marginal function Apr 18, 2025
@sansiro77 sansiro77 self-requested a review April 18, 2025 04:24
@sansiro77 sansiro77 self-assigned this Apr 18, 2025
@sansiro77 sansiro77 added the bugfix Fix bugs label Apr 18, 2025
@sansiro77 sansiro77 merged commit 4f0697e into TuringQ:main Apr 18, 2025
@Hugh-888 Hugh-888 deleted the hotfix-bosonic branch April 24, 2025 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants