Array initialize with tensor dimension

16 views
Skip to first unread message

KINGSHUK ADHIKARY

unread,
Oct 24, 2023, 4:47:51 PM10/24/23
to QuTiP: Quantum Toolbox in Python
Hello,

I want to initialize an array for a wavefunction that iterates with time and dimension and behaves like a tensor form of a Jaynes-Cummings-like model. How is this possible?

 I have simply initialized the wavefunction like np.zeros((itt_time,2*N,1),dtype=np.complex_) but cannot cast into a tensor state that contains the TLS and oscillator. Here, N=50.

In my program, the Hamiltonian looks like this: Quantum object: dims = [[2, 50], [2, 50]], shape = (100, 100), type = oper, isherm = true; where N=50 is the Hilbertspace dimension for the oscillator and 2 for TLS. Regarding this, I want the wavefunction of a quantum object: dims = [[2, 50], [1, 1]], shape = (100, 1), type = ket. I cannot initialize the array of wavefunctions in the previous way, and it changes with time.

Thank you in advance for any fruitful suggestion.


Kind regards,
Kingshuk

Diego Fpv

unread,
Oct 24, 2023, 10:03:45 PM10/24/23
to qu...@googlegroups.com
From the documentation:

The Qobj class is the QuTiP representation of quantum operators and state vectors. This class also implements math operations +,-,* between Qobj instances (and / by a C-number), as well as a collection of common operator/state operations. The Qobj constructor optionally takes a dimension list and/or shape list as arguments.

Parameters
inpt: array_like

Data for vector/matrix representation of the quantum object.

dims: list

Dimensions of object used for tensor products.

It is not clear to me why you want to store the wavefunctions in an array, rather than a list, but for example 

Qobj(np.zeros(2*N), dims=[2,N])

should give you a Qobj with the appropriate tensor structure. Then, you would need to create an array of Qobj (not an array of np.complex), if you want to retain the nice Qobj properties (i. e. the dims).

Good luck,
Diego
--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qutip/0efb94a0-4d57-41bd-a889-0f68b6d9c613n%40googlegroups.com.

KINGSHUK ADHIKARY

unread,
Oct 26, 2023, 1:15:53 PM10/26/23
to qu...@googlegroups.com
Hi Diego,
Thanks for your suggestion and it has been working for me. Though I think it is an indirect method to deal with my problem because after iteration of the array I again cast this single array element (matrix or state)  in terms of Qobj.

Thanks,
Kingshuk




Reply all
Reply to author
Forward
0 new messages