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

Single Charge Bases + DiagDevice #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

shoumikdc
Copy link
Collaborator

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 of qcsys is to pipeline diagonalizations via nested functions (i.e. JAX style). However, this means that any time we diagonalize a System, we are also diagonalizing each subsystem first. That is, simply calling qubit.get_H() involves diagonalizing a N_pre_diag-dimensional matrix. If N_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 a get_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 sweep g_ab]

Added a DiagDevice class to support pre-diagonalization from a npz file (in cases where we want N_pre_diag to be very large)
@shoumikdc shoumikdc requested a review from Phionx August 27, 2024 20:03
@Phionx
Copy link
Contributor

Phionx commented Aug 30, 2024

Hm, this seems against the functional paradigm of JAX. Let's discuss tmw.

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

Successfully merging this pull request may close these issues.

2 participants