Open danielwe opened 5 years ago
That would be a very nice improvement, but also a somewhat significant breaking change in the design. I would hold back with this until after the 2.0 release, and include it in 3.0. I especially like that we can have to same class represent a bosonic or a fermionic operator.
For the time being, we should just make sure that in 2.0 the documentation points out the potential pitfall of using bosonic operators when describing a physical finite-level system. The current philosophy of QNET is definitely point 1 (the dimension of a bosonic space is only the size we eventually want to truncate the basis to when writing out numerical representations of operators, that is, not a bug). But this may not be obvious to a user (it wasn't, to me!).
The current philosophy of QNET is definitely point 1 (the dimension of a bosonic space is only the size we eventually want to truncate the basis to when writing out numerical representations of operators, that is, not a bug).
It is both at the same time---that's precisely what the problem is. There is a conflation in terms of the meaning of dimension
. For example, spin systems are N-level systems where N certainly does not have anything to do with truncation.
Since intrinsic dimensionality and truncation are different concepts that enter in different stages of modeling, they should be kept logically separate in the code, with minimal risk of confusion.
I agree that the change is breaking and should be punted to a later version.
fermionic anticommutation relations in the case of two-level systems
I keep throwing around the word fermionic in the context of two-level systems. This is a note to myself and anyone else that actually implementing a fermionic field as a tensor product of two-level systems also requires anticommutation between creation and annihilation operators on different subspaces. In effect, the fermionic creation (annihilation) operator for subspace i
will be a tensor product of Jz
on all subspaces with index j < i
, and Jplus
(Jminus
) on subspace i
(see any reference that introduces fermionic Fock spaces). In other words, fermionic creation and annihilation operators cannot be defined on each two-level subspace in isolation but must be aware of the whole field. We must keep this in mind if we actually want to claim support for fermionic creation/annihilation operators at some point.
Everything said earlier is however valid for single two-level systems, whether they are interpreted as atomic two-level systems, spin-1/2 systems, or a single, isolated fermionic degree of freedom.
Currently, creation and annihilation operators can be defined on a
LocalSpace
of arbitrary dimension. The algebra will consider these as having bosonic commutation relations, regardless ofLocalSpace
dimensionality. This can be considered:LocalSpace
is understood as representing a true bosonic degree of freedom, and the dimension only as the size we eventually want to truncate the basis to when writing out numerical representations of operators;LocalSpace
is understood as the true dimensionality of the physical system we're modeling, and bycreate
we mean the operator that acts like a truncated bosonic creation operator on the states in this finite ladder (except for necessarily annihilating the top level).In the latter case, the operators represented by
Create
andDestroy
satisfy bosonic commutation relations only in the limit that the dimension is taken to infinity. This is most egregious in the case of a two-level system, for which it seems reasonable to interpretCreate
andDestroy
as fermionic creation and annihilation operators, satisfying fermionic anticommutation relationsa * a.dag() + a.dag() * a = 1
. This is also the relation satisfied by the matrices that QNET writes for these operators when asked:a -> [[0, 1], [0, 0]]; a.dag() -> [[0, 0], [1, 0]]
. When doing symbolic algebra, however, QNET will unapologetically assume bosonic commutation relations regardless of dimension.I think the solution to this is to treat the dimension of
LocalSpace
solely as the physical dimension. Thus, bosonic degrees of freedom should always use infinite dimension (i.e.,LocalSpace(..., dimension=None)
), and a finite dimension should be reserved for subspaces that actually have finite dimension in the physical model, such as angular momenta, spins, and fermions.If this is carried through, in order to avoid confusion, it should only be possible to instantiate
Create
andDestroy
with spaces of dimension either infinity or 2, i.e., bosons or fermions, since these are the only two cases where creation and annihilation operators are unambiguously and universally defined. Symbolically they should satisfy bosonic commutation relations in the case of infinite dimension, and fermionic anticommutation relations in the case of two-level systems. For other spaces of finite dimension, one should use angular momentum operatorsJplus, Jminus
to traverse the ladder.The notion of basis truncation should come into play only upon conversion to numerical matrices in
convert_to_qutip
andconvert_to_sympy_matrix
. These functions should take a mapping from all infinite-dimensionalLocalSpace
instances to the corresponding desired truncated basis sizes.This issue must be clarified to make sure that two-level systems can be safely used as fermionic degrees of freedom before considering a generalization of the supermode/Bogoliubov transformation idea (#89) to fermions.