Пример #1
0
def create_simulation(p):
    p_quenched = parameters.copy()
    p_quenched.omega = 0.1

    system = HarmonicTrapHim(p, x)
    system_quenched = HarmonicTrapHim(p_quenched, x)

    sim = mlxtk.Simulation("harmonic_trap")

    sim += mlxtk.tasks.CreateOperator("hamiltonian_1b",
                                      system.get_hamiltonian_1b())
    sim += mlxtk.tasks.CreateMBOperator("hamiltonian",
                                        system.get_hamiltonian())
    sim += mlxtk.tasks.CreateMBOperator(
        "hamiltonian_quenched",
        system_quenched.get_hamiltonian(),
    )

    sim += mlxtk.tasks.MCTDHBCreateWaveFunction("initial", "hamiltonian_1b",
                                                p.N, p.m)
    sim += mlxtk.tasks.Relax(
        "rlx",
        "initial",
        "hamiltonian",
        tfinal=1000.0,
        dt=0.01,
        psi=True,
        gauge=p.gauge,
    )
    # sim += mlxtk.tasks.ImprovedRelax(
    #     "imprlx",
    #     "initial",
    #     "hamiltonian",
    #     1,
    #     tfinal=1000.0,
    #     dt=0.01,
    #     psi=True,
    #     gauge=p.gauge)
    # sim += mlxtk.tasks.Propagate("propagate_rlx",
    #                              "rlx/final",
    #                              "hamiltonian_quenched",
    #                              tfinal=5.0,
    #                              dt=0.05,
    #                              psi=True,
    #                              gauge=p.gauge)
    # sim += mlxtk.tasks.Propagate(
    #     "propagate_imprlx",
    #     "imprlx/final",
    #     "hamiltonian_quenched",
    #     tfinal=5.0,
    #     dt=0.05,
    #     psi=True,
    #     gauge=p.gauge)

    return sim
Пример #2
0
    def create_simulation(p):
        p_quenched = p.copy()
        p_quenched.g = 0.2

        system = HarmonicTrap(p, x)
        system_quenched = HarmonicTrap(p_quenched, x)

        sim = mlxtk.Simulation("harmonic_trap")
        sim += mlxtk.tasks.CreateOperator(
            "hamiltonian_1b.opr",
            system.get_hamiltonian_1b(),
        )
        sim += mlxtk.tasks.CreateMBOperator(
            "hamiltonian.mb_opr",
            system.get_hamiltonian(),
        )
        sim += mlxtk.tasks.CreateMBOperator(
            "hamiltonian_quenched.mb_opr",
            system_quenched.get_hamiltonian(),
        )
        sim += mlxtk.tasks.CreateMBOperator("com.mb_opr",
                                            system.get_com_operator())
        sim += mlxtk.tasks.CreateMBOperator(
            "com_2.mb_opr",
            system.get_com_operator_squared(),
        )
        sim += mlxtk.tasks.MCTDHBCreateWaveFunction(
            "initial.wfn",
            "hamiltonian_1b.opr",
            p.N,
            p.m,
        )
        sim += mlxtk.tasks.ImprovedRelax(
            "gs_relax",
            "initial.wfn",
            "hamiltonian.mb_opr",
            "1",
            tfinal=1000.0,
            dt=0.01,
        )
        sim += mlxtk.tasks.Propagate(
            "propagate",
            "gs_relax/final.wfn",
            "hamiltonian_quenched.mb_opr",
            tfinal=5.0,
            dt=0.05,
            psi=True,
        )
        sim += mlxtk.tasks.ComputeExpectationValue("propagate/psi",
                                                   "com.mb_opr")
        sim += mlxtk.tasks.ComputeExpectationValue("propagate/psi",
                                                   "com_2.mb_opr")
        sim += mlxtk.tasks.ComputeVariance("propagate/com", "propagate/com_2")

        return sim
Пример #3
0
def create_simulation(p: mlxtk.parameters.Parameters):
    p_quenched = p.copy()
    p_quenched.g = 0.2

    system = HarmonicTrap(p, x)

    sim = mlxtk.Simulation("harmonic_trap")
    sim += mlxtk.tasks.CreateOperator("hamiltonian_1b", system.get_hamiltonian_1b())
    sim += mlxtk.tasks.CreateMBOperator("hamiltonian", system.get_hamiltonian())
    sim += mlxtk.tasks.MCTDHBCreateWaveFunction("initial", "hamiltonian_1b", p.N, p.m)
    sim += mlxtk.tasks.ImprovedRelax(
        "gs_relax",
        "initial",
        "hamiltonian",
        "1",
        tfinal=1000.0,
        dt=0.01,
    )

    return sim
Пример #4
0
    def create_simulation(p):
        p_quenched = p.copy()
        p_quenched.g = 0.0

        system_quenched = HarmonicTrap(p_quenched, x)

        sim = mlxtk.Simulation("harmonic_trap")
        sim += mlxtk.tasks.CreateMBOperator(
            "hamiltonian_quenched",
            system_quenched.get_hamiltonian(),
        )
        sim += mlxtk.tasks.RequestWaveFunction("initial", p, "harmonic_gs.py")
        sim += mlxtk.tasks.Propagate(
            "propagate",
            "initial",
            "hamiltonian_quenched",
            tfinal=5.0,
            dt=0.05,
            psi=True,
        )

        return sim
Пример #5
0
#!/usr/bin/env python
import mlxtk
from mlxtk.systems.single_species.harmonic_trap import HarmonicTrap

if __name__ == "__main__":
    x = mlxtk.dvr.add_harmdvr(512, 0.0, 1.0)

    parameters = HarmonicTrap.create_parameters()
    parameters.m = 19

    parameters_quenched = parameters.copy()
    parameters_quenched.omega = 0.7

    system = HarmonicTrap(parameters, x)
    system_quenched = HarmonicTrap(parameters_quenched, x)

    sim = mlxtk.Simulation("spectrum")

    sim += mlxtk.tasks.CreateOperator("hamiltonian_1b", system.get_hamiltonian_1b())
    sim += mlxtk.tasks.ComputeSpectrum("hamiltonian_1b", parameters.m)

    sim.main()
Пример #6
0
from mlxtk.systems.bose_bose.two_gaussian_traps import TwoGaussianTraps

grid = mlxtk.dvr.add_sinedvr(300, -10, 10)

parameters = TwoGaussianTraps.create_parameters()
parameters.N_A = 2
parameters.N_B = 2
parameters.M_A = 3
parameters.M_B = 4
parameters.m_A = 5
parameters.m_B = 6
parameters.V0L = 20.0
parameters.V0R = 20.0

if __name__ == "__main__":
    sim = mlxtk.Simulation("gaussian_wells")

    system = TwoGaussianTraps(parameters, grid)

    sim += tasks.CreateOperator(
        "hamiltonian_1b_A.opr",
        system.get_hamiltonian_left_well_1b_A(),
    )
    sim += tasks.CreateOperator(
        "hamiltonian_1b_B.opr",
        system.get_hamiltonian_right_well_1b_B(),
    )
    sim += tasks.CreateMBOperator(
        "hamiltonian_relax.mb_opr",
        system.get_hamiltonian_left_right(),
    )
Пример #7
0
#!/usr/bin/env python
import mlxtk
from mlxtk import tasks
from mlxtk.systems.single_species.bose_hubbard import BoseHubbard

parameters = BoseHubbard.create_parameters()
parameters.N = 4
parameters.m = 4
parameters.sites = 4
parameters.pbc = True

if __name__ == "__main__":
    system = BoseHubbard(parameters)

    sim = mlxtk.Simulation("bose_hubbard")
    sim += tasks.CreateOperator(
        "fake_hamiltonian.opr",
        system.get_fake_initial_state_hamiltonian(),
    )
    sim += tasks.CreateMBOperator("hamiltonian.mb_opr",
                                  system.get_hamiltonian())
    sim += tasks.MCTDHBCreateWaveFunction(
        "initial.wfn",
        "fake_hamiltonian.opr",
        parameters.N,
        parameters.m,
        system.distribute_particles(),
    )
    sim += tasks.Relax(
        "gs_relax",
        "initial.wfn",
Пример #8
0
parameters = HarmonicTrap.create_parameters()
parameters.N = 2
parameters.m = 3
parameters.g = 0.1
parameters.x0 = 10.0

if __name__ == "__main__":

    parameters_quenched = parameters.copy()
    parameters_quenched.x0 = 0.0

    system = HarmonicTrap(parameters, grid)
    system_quenched = HarmonicTrap(parameters_quenched, grid)

    sim = mlxtk.Simulation("harmonic_trap")

    sim += tasks.CreateOperator("hamiltonian_1b.opr",
                                system.get_hamiltonian_1b())
    sim += tasks.CreateMBOperator("hamiltonian.mb_opr",
                                  system.get_hamiltonian())
    sim += tasks.CreateMBOperator(
        "hamiltonian_quenched.mb_opr",
        system_quenched.get_hamiltonian(),
    )
    sim += tasks.CreateMBOperator("com.mb_opr",
                                  system_quenched.get_com_operator())
    sim += tasks.CreateMBOperator(
        "com_2.mb_opr",
        system_quenched.get_com_operator_squared(),
    )