Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding some small fixes to the single charge basis of the transmon - in particular, we now have three separate single charge bases (full, even, odd). With this, I think the single-charge basis is fully fleshed out.
Also added a
DiagDevice
. The whole point ofqcsys
is to pipeline diagonalizations via nested functions (i.e. JAX style). However, this means that any time we diagonalize aSystem
, we are also diagonalizing each subsystem first. That is, simply callingqubit.get_H()
involves diagonalizing aN_pre_diag
-dimensional matrix. IfN_pre_diag
for each subsystem is large (e.g. >1000), then this gets very slow when working with systems.My proposed solution is to diagonalize each subsystem once and save the resulting (truncated) eigenvalues to a file (e.g. npz). Then, we can create a new
DiagDevice
, whose Hamiltonian is diagonal and is already written in the energy eigenbasis. This class has aget_H()
method, so it is compatible with other devices. This will speed up the construction of composite system Hamiltonians, since instead of having to rediagonalize each subsystem, we can just use the stored data.[The specific use case where this is highly advantageous is when we want to sweep the coupling between two fixed subsystems, e.g.
H_total = H_a + H_b + g_ab * H_int
where we sweepg_ab
]