示例#1
0
    def hamiltonian_use_addhc(self):
        res1 = qubit.Oscillator(
            E_osc=6.0,
            truncated_dim=4  # up to 3 photons (0,1,2,3)
        )

        res2 = qubit.Oscillator(
            E_osc=5.5,
            truncated_dim=7
        )

        # Form a list of all components making up the Hilbert space.
        hilbertspace = HilbertSpace([res1, res2])

        g1 = 0.29

        interaction1 = InteractionTerm(
            g_strength=g1,
            op1=res1.annihilation_operator(),
            subsys1=res1,
            op2=res2.creation_operator(),
            subsys2=res2,
            add_hc=True
        )

        interaction_list = [interaction1]
        hilbertspace.interaction_list = interaction_list
        return hilbertspace.hamiltonian()
示例#2
0
    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
示例#3
0
    def hilbertspace_initialize():
        fluxonium = scq.Fluxonium.create()
        fluxonium.truncated_dim = 3
        zpifull = scq.FullZeroPi.create()
        zpifull.truncated_dim = 2
        zpifull.grid.pt_count = 20

        # Form a list of all components making up the Hilbert space.
        hilbertspace = HilbertSpace([fluxonium, zpifull])

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

        hilbertspace.add_interaction(
            g=g1, op1=fluxonium.n_operator, op2=zpifull.n_theta_operator
        )
        return hilbertspace
示例#4
0
    def hamiltonian_use_addhc(self):
        res1 = scq.Oscillator(E_osc=6.0, truncated_dim=4)
        res2 = scq.Oscillator(E_osc=5.5, truncated_dim=7)

        # Form a list of all components making up the Hilbert space.
        hilbertspace = HilbertSpace([res1, res2])

        g1 = 0.29

        hilbertspace.add_interaction(
            g=g1,
            op1=res1.annihilation_operator,
            op2=res2.creation_operator,
            add_hc=True,
        )
        return hilbertspace.hamiltonian()
示例#5
0
    def _update_and_compute_dressed_esys(
        self,
        hilbertspace: HilbertSpace,
        evals_count: int,
        update_func: Callable,
        paramindex_tuple: Tuple[int],
    ) -> ndarray:
        paramval_tuple = self._parameters[paramindex_tuple]
        update_func(*paramval_tuple)

        assert self._data is not None
        bare_esys = {
            subsys_index: [
                self._data["bare_evals"][subsys_index][paramindex_tuple],
                self._data["bare_evecs"][subsys_index][paramindex_tuple],
            ]
            for subsys_index, _ in enumerate(self._hilbertspace)
        }

        evals, evecs = hilbertspace.eigensys(evals_count=evals_count,
                                             bare_esys=bare_esys)
        esys_array = np.empty(shape=(2, ), dtype=object)
        esys_array[0] = evals
        esys_array[1] = evecs
        return esys_array
示例#6
0
    def hilbertspace_initialize_2():
        fluxonium = scq.Fluxonium.create()
        zpifull = scq.FullZeroPi.create()

        # Form a list of all components making up the Hilbert space.
        hilbertspace = HilbertSpace([fluxonium, zpifull])

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

        interaction1 = InteractionTerm(g_strength=g1,
                                       op1=fluxonium.n_operator(),
                                       subsys1=fluxonium,
                                       op2=zpifull.n_theta_operator(),
                                       subsys2=zpifull)

        interaction_list = [interaction1]
        hilbertspace.interaction_list = interaction_list
        return hilbertspace
示例#7
0
    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
示例#8
0
    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
示例#9
0
    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