Git Product home page Git Product logo

Comments (4)

david-pl avatar david-pl commented on June 11, 2024

I agree that a general multi-level basis is interesting for many applications. As of now I have not encountered any other operators that would be required. However, I am unsure whether requiring a list of energies is really the best way to initialize the basis. On the one hand, it does help you to keep track of your system (namely, which level has what energy). On the other hand, there may be occurrences where it is better to exclude the energies from the basis. For example, if you want to do a parameter scan over some energy, then there are currently two solutions: Either you initialize the basis in every step of the scan which is neither efficient nor elegant, or you define all energies that include the scanning parameter as zero and later write them explicitly (with corresponding projectors in the Hamiltonian), which is again not too elegant. This also applies to any time-dependent energies in a Hamiltonian and such.
I am, however, also not sure of any better alternatives (maybe just pass one integer that defines the size of the basis?). Nevertheless I wanted to start a discussion on this.

from quantumoptics.jl.

bastikr avatar bastikr commented on June 11, 2024

After thinking a little bit about it I agree that it is probably cleaner to not include the energies in the basis. First I just want to mention that creating a new basis in every step of a parameter scan or in time dependent Hamiltonians is not really a problem since creating a basis is most likely a cheap operation compared to creating the new numerical representation of the operators. Also it would definitely help to avoid mistakes involving mixing operators corresponding to different n-level systems. However, the n-level basis definitely has similarities to the fock basis and there we also don't include the energy spacing in the definition of the basis. This alone convinces me to define the nlevel basis in a similar way:

type NLevelBasis <: Basis
    shape::Vector{Int}
    N::Int
    function NLevelBasis(N::Int)
        if N < 1
            throw(DimensionMismatch())
        end
        new([N], N)
    end
end

At the moment I can think of two things that should be easy to achieve with this basis:

  • Creating the diagonal part of the Hamiltonian H = sum_n E_n |n><n|
    For a fockbasis we can do H = omega*create(b)⊗destroy(b). I can't think of a similarly idiomatic way to do the same for this basis. My idea would be to implement something like diagonaloperator(b, energies) in general for all bases.

  • Transitions |n><m|
    I think the current implementation is fine. Maybe we should also define this function for fock bases.

from quantumoptics.jl.

david-pl avatar david-pl commented on June 11, 2024

Thanks for your response and the according changes. I also think we should - for completeness and again in analogy to the fock basis - add a function for the basis states, such that you can initialize the system in state n with something like nlevelstate(b::NLevelBasis, n::Int).

As for your other comments:

  • A generalized diagonal operator is a good idea and should be straightforward to implement.

  • The current implementation of transitions does indeed work very well. For fock bases, however, I am not sure if transitions aren't better covered by raising and lowering operators. So far, I have not encountered the use of other transition operators when working with fock bases.

from quantumoptics.jl.

bastikr avatar bastikr commented on June 11, 2024

I updated the nlevel branch according to this discussion. Sorry David I didn't see you already implemented a nlevelstate function. Additionally I added docstrings, (sparse) documentation and a few more tests. This should be ready to merge soon #10 . Can you review @david-pl? For the diagonaloperator there now is a separate issue #9.

from quantumoptics.jl.

Related Issues (20)

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.