Skip to content

Update dependencies and fix Wigner function#137

Merged
sansiro77 merged 2 commits intoTuringQ:mainfrom
sansiro77:dev-hjj
Feb 2, 2026
Merged

Update dependencies and fix Wigner function#137
sansiro77 merged 2 commits intoTuringQ:mainfrom
sansiro77:dev-hjj

Conversation

@sansiro77
Copy link
Copy Markdown
Contributor

@sansiro77 sansiro77 commented Jan 30, 2026

Example usage

  • Fock state
cir = dq.QumodeCircuit(1, 'vac', cutoff=10, backend='fock', basis=False)
cir.s(0, 1)
s = cir()
state = dq.FockState(s, basis=False)
w = state.wigner(wire=0)
image
  • Gaussian state
cir = dq.QumodeCircuit(1, 'vac', backend='gaussian')
cir.s(0, 1)
s = cir()
state = dq.GaussianState(s)
w = state.wigner(wire=0)
image
  • Bosonic state
cir = dq.QumodeCircuit(1, 'vac', backend='bosonic')
cir.cat(0, r=2, theta=0)
s = cir()
state = dq.BosonicState(s)
w = state.wigner(wire=0)
image

@sansiro77 sansiro77 requested a review from Hugh-888 January 30, 2026 11:22
@sansiro77 sansiro77 self-assigned this Jan 30, 2026
@sansiro77 sansiro77 added documentation Improvements or additions to documentation bugfix Fix bugs labels Jan 30, 2026
pvec (torch.Tensor): 1D grid for quadrature p.
k (int, optional): The index of the Wigner function within the batch to plot. Default: 0
"""
grid_x, grid_y = torch.meshgrid(xvec, pvec, indexing='ij')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

plot 代码统一调整

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

已修改

@sansiro77 sansiro77 merged commit e69dd6b into TuringQ:main Feb 2, 2026
@sansiro77 sansiro77 deleted the dev-hjj branch February 2, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix bugs documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants