You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use QuantumOptics.jl to study an array of coupled resonators, with coherent pumping and dissipation.
I've always used QuTip, and I'm curious as to wherever Julia is faster or not...
Normally I build my local operators in the manybody basis by calling tensor() on a list of local operators. For example, if I want to write operator my_op in the many body basis, for N cavities with a Hilbert space of dimension M I normally do:
op_list = []
for i in range(N):
op_list.append(identity(M))
op_list[0] = my_op
O_local = tensor(op_list)
Unfortunately, it seems that QuantumOptics.tensor() does not support a list as an input. How would you go about setting up something similar?
The text was updated successfully, but these errors were encountered:
While it's true, that tensor cannot handle lists, you can just expand the arguments to achieve what you want. This is done by doing tensor(op_list...). Here, op_list... is equivalent to *op_list in Python.
However, you might want to check out the embed function, which can be used to more elegantly build operators of this composite form (it adds identities on all Hilbert spaces, but the indexed one).
So in QuantumOptics.jl you can rewrite the short example you provided by
bf =FockBasis(M)
b = bf^3# Product basis of 3 cavities
O_local =embed(b, 1, my_op)
The integer argument in embed specifies the Hilbert space on which my_op acts.
If you need any more help, please let me know. You can also ask them on our gitter chat https://gitter.im/QuantumOptics-jl/Lobby if you prefer a more casual platform.
I'm trying to use QuantumOptics.jl to study an array of coupled resonators, with coherent pumping and dissipation.
I've always used QuTip, and I'm curious as to wherever Julia is faster or not...
Normally I build my local operators in the manybody basis by calling tensor() on a list of local operators. For example, if I want to write operator
my_op
in the many body basis, forN cavities
with a Hilbert space ofdimension M
I normally do:Unfortunately, it seems that QuantumOptics.tensor() does not support a list as an input. How would you go about setting up something similar?
The text was updated successfully, but these errors were encountered: