Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operators in manybody basis #219

Closed
PhilipVinc opened this issue Jun 11, 2018 · 1 comment
Closed

Operators in manybody basis #219

PhilipVinc opened this issue Jun 11, 2018 · 1 comment

Comments

@PhilipVinc
Copy link
Contributor

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?

@david-pl
Copy link
Member

Glad to here you want to try out our framework.

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.

@david-pl david-pl closed this as completed Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants