def hilbertspace_initialize2(): CPB1 = scq.Transmon(EJ=40.0, EC=0.2, ng=0.0, ncut=40, truncated_dim=3) CPB2 = scq.Transmon(EJ=3.0, EC=1.0, ng=0.0, ncut=10, truncated_dim=4) resonator = scq.Oscillator(E_osc=6.0, truncated_dim=4) # up to 3 photons (0,1,2,3) # Form a list of all components making up the Hilbert space. hilbertspace = HilbertSpace([CPB1, CPB2, resonator]) g1 = 0.1 # coupling resonator-CPB1 (without charge matrix elements) g2 = 0.2 # coupling resonator-CPB2 (without charge matrix elements) hilbertspace.add_interaction( g=g1, op1=CPB1.n_operator, op2=resonator.creation_operator, add_hc=True ) hilbertspace.add_interaction( g=g2, op1=(CPB2.n_operator(), CPB2), op2=( resonator.creation_operator() + resonator.annihilation_operator(), resonator, ), ) return hilbertspace
def hilbertspace_initialize(): CPB1 = qubit.Transmon( EJ=40.0, EC=0.2, ng=0.0, ncut=40, truncated_dim=3 # after diagonalization, we will keep 3 levels ) CPB2 = qubit.Transmon( EJ=3.0, EC=1.0, ng=0.0, ncut=10, truncated_dim=4 ) resonator = qubit.Oscillator( E_osc=6.0, truncated_dim=4 # up to 3 photons (0,1,2,3) ) # Form a list of all components making up the Hilbert space. hilbertspace = HilbertSpace([CPB1, CPB2, 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, op1=CPB1.n_operator(), subsys1=CPB1, op2=resonator.creation_operator() + resonator.annihilation_operator(), subsys2=resonator ) interaction2 = InteractionTerm( g_strength=g2, op1=CPB2.n_operator(), subsys1=CPB2, op2=resonator.creation_operator() + resonator.annihilation_operator(), subsys2=resonator ) interaction_list = [interaction1, interaction2] hilbertspace.interaction_list = interaction_list return hilbertspace
def hilbertspace_initialize(): transmon1 = qubit.Transmon( EJ=40.0, EC=0.2, ng=0.0, ncut=40, truncated_dim=3 # after diagonalization, we will keep 3 levels ) transmon2 = qubit.Transmon(EJ=3.0, EC=1.0, ng=0.0, ncut=10, truncated_dim=4) resonator = qubit.Oscillator( omega=6.0, truncated_dim=4 # up to 3 photons (0,1,2,3) ) # Form a list of all components making up the Hilbert space. return qubit.HilbertSpace([transmon1, transmon2, resonator])
def initialize(self): # Set up the components / subspaces of our Hilbert space # Set up the components / subspaces of our Hilbert space CPB1 = qubit.Transmon( EJ=40.0, EC=0.2, ng=0.3, ncut=40, truncated_dim=3 # after diagonalization, we will keep 3 levels ) CPB2 = qubit.Transmon( EJ=30.0, EC=0.15, ng=0.0, ncut=10, truncated_dim=4 ) resonator = qubit.Oscillator( E_osc=6.0, truncated_dim=4 # up to 3 photons (0,1,2,3) ) # Form a list of all components making up the Hilbert space. hilbertspace = HilbertSpace([CPB1, CPB2, 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, op1=CPB1.n_operator(), subsys1=CPB1, op2=resonator.creation_operator() + resonator.annihilation_operator(), subsys2=resonator ) interaction2 = InteractionTerm( g_strength=g2, op1=CPB2.n_operator(), subsys1=CPB2, op2=resonator.creation_operator() + resonator.annihilation_operator(), subsys2=resonator ) interaction_list = [interaction1, interaction2] hilbertspace.interaction_list = interaction_list param_name = 'flux' # name of varying external parameter param_vals = np.linspace(0., 2.0, 300) # parameter values subsys_update_list = [CPB1, CPB2] # list of HilbertSpace subsystems which are affected by parameter changes def update_hilbertspace(param_val): # function that shows how Hilbert space components are updated CPB1.EJ = 20 * np.abs(np.cos(np.pi * param_val)) CPB2.EJ = 15 * np.abs(np.cos(np.pi * param_val * 0.65)) sweep = ParameterSweep( param_name=param_name, param_vals=param_vals, evals_count=20, hilbertspace=hilbertspace, subsys_update_list=subsys_update_list, update_hilbertspace=update_hilbertspace ) return sweep
def initialize(self, num_cpus): # Set up the components / subspaces of our Hilbert space scq.settings.MULTIPROC = "pathos" CPB1 = scq.Transmon( EJ=40.0, EC=0.2, ng=0.0, ncut=40, truncated_dim=3, # after diagonalization, we will keep 3 levels ) CPB2 = scq.Transmon(EJ=3.0, EC=1.0, ng=0.0, ncut=10, truncated_dim=4) resonator = scq.Oscillator( E_osc=6.0, truncated_dim=4) # up to 3 photons (0,1,2,3) # Form a list of all components making up the Hilbert space. hilbertspace = HilbertSpace([CPB1, CPB2, 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, op1=CPB1.n_operator(), subsys1=CPB1, op2=resonator.creation_operator() + resonator.annihilation_operator(), subsys2=resonator, ) interaction2 = InteractionTerm( g_strength=g2, op1=CPB2.n_operator(), subsys1=CPB2, op2=resonator.creation_operator() + resonator.annihilation_operator(), subsys2=resonator, ) interaction_list = [interaction1, interaction2] hilbertspace.interaction_list = interaction_list param_name = "flux" # name of varying external parameter param_vals = np.linspace(-0.1, 0.6, 100) # parameter values subsys_update_list = [ CPB1 ] # list of HilbertSpace subsys_list which are affected by parameter changes def update_hilbertspace( param_val): # function that shows how Hilbert space # components are updated CPB1.EJ = 40.0 * np.cos(np.pi * param_val) sweep = ParameterSweep( param_name=param_name, param_vals=param_vals, evals_count=15, hilbertspace=hilbertspace, subsys_update_list=subsys_update_list, update_hilbertspace=update_hilbertspace, num_cpus=num_cpus, ) return sweep
import scqubits as qubit import scqubits.utils.plotting as plot import numpy as np import matplotlib.pyplot as plt transmon = qubit.Transmon(EJ=30.02, EC=1.2, ng=0.3, ncut=31) print(transmon.eigenvals(evals_count=12)) ng_list = np.linspace(-2, 2, 220) temp = transmon.plot_evals_vs_paramvals('ng', ng_list, evals_count=5, subtract_ground=False) #print(temp) transmon.plot_phi_wavefunction(esys=None, which=[0, 1, 2, 3, 4], mode='real') plt.show()
''' Two transmons coupled to a resonator Follow the link for details https://scqubits.readthedocs.io/en/latest/guide/ipynb/hilbertspace.html#Example:-two-transmons-coupled-to-a-harmonic-mode ''' import scqubits as qubit import scqubits.utils.plotting as plot import numpy as np from scqubits import HilbertSpace, InteractionTerm, ParameterSweep import qutip as qt import matplotlib.pyplot as plt tmon1 = qubit.Transmon(EJ=40,EC=0.2,ng=0.3, ncut=40, truncated_dim=4) tmon2 = qubit.Transmon(EJ=15.0, EC=0.15, ng=0.0, ncut=30,truncated_dim=4) resonator = qubit.Oscillator( E_osc=4.5, truncated_dim=4 # up to 3 photons (0,1,2,3) ) hilbertspace = qubit.HilbertSpace([tmon1, tmon2, resonator]) print(hilbertspace) bare_hamiltonian = hilbertspace.bare_hamiltonian() print("---------- Bare Hamiltonian -------------") print(bare_hamiltonian) #plt.show()