Coder Social home page Coder Social logo

phasespacetools.jl's Introduction

PhaseSpaceTools

Dev Build Status Coverage DOI

Sample quantum initial states commonly encountered in quantum phase space simulations of Bose fields, including those encountered in quantum optics and Bose-Einstein condensates.

Wigner and positive-P distributions are available, being the most useful for dynamical simulations.

Available distributions are glauberP, positiveP wigner, positiveW, husimiQ.

Install

julia> ]add PhaseSpaceTools

Usage

julia> using PhaseSpaceTools

help?> positiveP
search: positiveP positiveW

  α,α⁺ = positiveP(state <: State,N)

  Generate N samples from the positive-P (+P) phase-space distribution for state.

  Moments of the +P distribution generate quantum operator averages that are normally ordered.

  In general the two random variates α,α⁺ are statistically independent for the +P distribution. 

Implemented states

help?> State
search: State state estimate InvalidStateException AbstractSet AbstractVector AbstractVecOrMat stacktrace StackTraces istaskstarted abstract type AbstractRange AbstractPattern

  State

  Abstract supertype for all sampled states: state <: State.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  Find all states that may be sampled
  =====================================

  julia> subtypes(State)
  
  6-element Vector{Any}:
  Bogoliubov
  Coherent
  Crescent
  Fock
  Squeezed
  Thermal

  Create and sample a particular state (vacuum)
  ===============================================

  julia> s = Fock(0)
  Fock(0)
  julia> wigner(s,100)
  ┌ Warning: Fock state sampling for W is only valid for n  1.

  Here a warning is generated since Fock sampling is not well defined for small n. 

  A simpler way to sample the vacuum is 

  julia> s = Coherent(0) 
  Coherent(0.0 + 0.0im)  # type conversion to ComplexF64.
  
  julia> wigner(s,100)
  (ComplexF64[0.33820868828162637 + 0.4407579103538181im, 0.057183146091823775 - 0.2772571883006981im, ...

  generating two vectors of sampled points α,α⁺ in the complex plane. In this case, α = conj(α⁺), as we are not working with a doubled phase space.

Coherent state

A coherent state |α⟩ is sampled as

α = 1.0+im*2.0 # coherent amplitude
s = Coherent(α) # define state |α⟩
N = 1000 # number of samples
a,a⁺ = positiveP(s,N)

This is a special case where the two phase space variables a and a⁺ are complex conjugate, and non-stochastic in the +P representation.

Fock state

An approximate Fock state sampler in the Wigner representation:

n = 100
s = Fock(n) # define number state |n⟩
N = 1000 # number of samples
a,a⁺ = wigner(s,N)

Provides an approximate sampling of W that reproduces operator averages for large n.

Examples

See /examples/PhaseSpaceTools.ipynb for more usage.

External links

Numerical representation of quantum states in the positive-P and Wigner representations,
M K Olsen, A S Bradley,
Optics Communications 282, 3924 (2009)

Scipost Commentary with full erratum

phasespacetools.jl's People

Contributors

ashtonsbradley avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gharib85

phasespacetools.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.