Skip to content

Updated demo_legacy_explorer.ipynb #13

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

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

Conversation

ahkatlio
Copy link

Fixed the issues:

Gave a detailed description:

We are creating two quantum systems using the scq library.

  1. Fluxonium: This is a type of superconducting circuit, a quantum system that can be used as a qubit (the basic unit of quantum information). The parameters EJ, EC, EL, flux, cutoff, and truncated_dim are specific to the physics of the Fluxonium system.

  2. Oscillator: This represents a quantum harmonic oscillator, a system that, when undisturbed, oscillates at some steady frequency. E_osc is the energy of the oscillator and truncated_dim is the dimension after truncation.

Here's a brief explanation of the parameters:

  • EJ, EC, EL: Energy scales for the Fluxonium system (Josephson, charging, and inductive energy respectively).
  • flux: External magnetic flux applied to the Fluxonium circuit.
  • cutoff: The maximum number of charge states included in the Hilbert space.
  • truncated_dim: The dimension of the Hilbert space after it has been truncated.
  • E_osc: Energy of the quantum harmonic oscillator.

the code I fixed:

# Define the interaction term
interaction_term = InteractionTerm(
    g_strength=0.2,
    operator_list=[(0, qbt.n_operator()), (1, osc.creation_operator() + osc.annihilation_operator())]
)

# Define the subsystem list
subsystem_list = [qbt, osc]

# Get the Hamiltonian
hamiltonian = interaction_term.hamiltonian(subsystem_list)

# Print the Hamiltonian
dressed_hamiltonian = hilbertspace.hamiltonian()
dressed_hamiltonian
param_name = r'$\Phi_{ext}/\Phi_0$'
param_vals = np.linspace(-0.5, 0.5, 100)

subsys_update_list = [qbt]

def update_hilbertspace(param_val):
    qbt.flux = param_val

sweep = ParameterSweep(
    hilbertspace=hilbertspace,
    paramvals_by_name={param_name: param_vals},
    update_hilbertspace=update_hilbertspace,
    evals_count=10,
    subsys_update_info={'qbt': subsys_update_list},
    num_cpus=4
)
# Create an Explorer object
explorer = Explorer(sweep=sweep, ncols=3)
qbt1 = scq.Transmon(
     EJ=25.0,
     EC=0.2,
     ng=0,
     ncut=30,
     truncated_dim=3)

qbt2 = scq.Transmon(
     EJ=15.0,
     EC=0.15,
     ng=0,
     ncut=30,
     truncated_dim=3)

resonator = scq.Oscillator(
    E_osc=5.5,
    truncated_dim=4)

hilbertspace = HilbertSpace([qbt1, qbt2, resonator])

g1 = 0.1  # coupling resonator-CPB1 (without charge matrix elements)
g2 = 0.2  # coupling resonator-CPB2 (without charge matrix elements)

interaction1 = InteractionTerm(
    g_strength=g1,
    operator_list=[(0, qbt1.n_operator()), (2, resonator.creation_operator() + resonator.annihilation_operator())],
    add_hc=False
)

interaction2 = InteractionTerm(
    g_strength=g2,
    operator_list=[(1, qbt2.n_operator()), (2, resonator.creation_operator() + resonator.annihilation_operator())],
    add_hc=False
)

interaction_list = [interaction1, interaction2]
hilbertspace.interaction_list = interaction_list

# Print the interaction terms
for i, interaction in enumerate(interaction_list, 1):
    print(f"Interaction {i}:")
    print(interaction)
param_name = r'$\Phi_{ext}/\Phi_0$'
param_vals = np.linspace(0.0, 1.0, 150)

subsys_update_list = [qbt1, qbt2]


def update_hilbertspace(param_val):     # function that shows how Hilbert space components are updated
    qbt1.EJ = 30*np.abs(np.cos(np.pi * param_val))
    qbt2.EJ = 40*np.abs(np.cos(np.pi * param_val * 2))
    

sweep = ParameterSweep(
    hilbertspace=hilbertspace,
    paramvals_by_name={param_name: param_vals},
    update_hilbertspace=update_hilbertspace,
    evals_count=10,
    subsys_update_info={'qbt': subsys_update_list},
    num_cpus=4
)

They are not showing any errors

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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.

1 participant