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

LazyTensor and FFTOperators ? #264

Closed
savowe opened this issue Mar 3, 2020 · 2 comments
Closed

LazyTensor and FFTOperators ? #264

savowe opened this issue Mar 3, 2020 · 2 comments

Comments

@savowe
Copy link

savowe commented Mar 3, 2020

Hello.
Is it currently possible to achieve time-propagation of a compoung system with internal and external degrees of freedom ( e.g. Hilbert space of NLevelBasis(2)⊗PositionBasis(x_min, x_max, N_x), with a Hamiltonian for the external parts in the form 1⊗V(x)+1⊗p^2/2) using the FFT Operators and not numerical diagonalization?
The LazyTensor is only able to work on sparse and dense operators and therefore need to be used before application of LazyProduct and LazySum.
However, one can not make a tensorproduct of a sparse and a FFTOperator:

using QuantumOptics
internal_basis = NLevelBasis(2)
position_basis = PositionBasis(-5, 5, 1024)
momentum_basis = MomentumBasis(position_basis)
Tpx = transform(momentum_basis, position_basis)
Txp = dagger(Tpx)
x = position(position_basis)
p = momentum(momentum_basis)
# LazyTensor of internal degree of freedom and kinetic operator in momentum basis (meant as 1⊗V(x)+1⊗p^2/2)
H_kin_p = LazyTensor(internal_basis⊗momentum_basis ,[2], [p])^2/2
# The naive thing does not work:
H_kin_x = LazyProduct(identityoperator(internal_basis) ⊗ Txp, H_kin_p, identityoperator(internal_basis) ⊗ Tpx)

Is there a workaround for that?

@david-pl
Copy link
Member

david-pl commented Mar 9, 2020

The trick is to create the FFTOperator directly on the composite basis and then use a LazyProduct.
Changing your code like this should work:

using QuantumOptics
internal_basis = NLevelBasis(2)
position_basis = PositionBasis(-5, 5, 1024)
momentum_basis = MomentumBasis(position_basis)
Tpx = transform(internal_basismomentum_basis, internal_basisposition_basis)
Txp = dagger(Tpx)
x = position(position_basis)
p = momentum(momentum_basis)
H_kin_p = one(internal_basis)p
H_kin_x = LazyProduct(Txp, H_kin_p, Tpx)

@savowe
Copy link
Author

savowe commented Mar 9, 2020

Indeed, it works. Thank you

@savowe savowe closed this as completed Mar 9, 2020
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