Skip to content

Solving problems with time-dependent Hamiltonians #338

@ColinVendromin

Description

@ColinVendromin

Describe the Issue!

Hi, I am trying to solve a problem with a time-dependent Hamiltonian using QuantumToolbox.jl and sesolve(). My Julia version is 1.11.2

Here is the simplest example of my code:

Screen Shot 2024-12-08 at 1 07 56 AM

When I run this I get the following error:

Screen Shot 2024-12-08 at 1 09 07 AM

I believe the error is caused because H is a tuple but the sesolve() function is expecting it to be a quantum object type. Here are the types of the relevant things in my code:

julia> typeof(H)
Tuple{QuantumObject{SparseMatrixCSC{ComplexF64, Int64}, OperatorQuantumObject}, typeof(C1_coeff)}

julia> typeof(C1_coeff)
typeof(C1_coeff) (singleton type of function C1_coeff, subtype of Function)

julia> typeof(H1)
QuantumObject{SparseMatrixCSC{ComplexF64, Int64}, OperatorQuantumObjec
t}

As you can see my H is a tuple of operator-function pairs and when I look at the documentation for sesolve() online it says the Hamiltonian can be of this tuple type:

H: Hamiltonian of the system \hat{H}. It can be either a QuantumObject, a QuantumObjectEvolution, or a Tuple of operator-function pairs.

So since my H is a tuple of operator-function pairs I shouldn't be getting an error...right?

I am hoping that someone here can help me solve this issue.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions