예제 #1
0
        ]

        # test_states = ion.FiniteSquareWellState.all_states_of_well_from_parameters(depth, width, mass) + plane_waves
        test_states = ion.FiniteSquareWellState.all_states_of_well_from_parameters(
            depth, width, mass)

        sim = ion.LineSpecification(
            "fsw",
            x_bound=space_bound,
            x_points=2**14,
            internal_potential=pot,
            electric_potential=electric,
            test_mass=mass,
            test_states=test_states,
            dipole_gauges=(),
            initial_state=init,
            # time_initial = 0, time_final = 1000 * asec, time_step = 1 * asec,
            time_initial=-pw * time_bound * asec,
            time_final=pw * time_bound * asec,
            time_step=1 * asec,
            minimum_time_final=3 * pw * time_bound * asec,
            mask=ion.RadialCosineMask(inner_radius=space_bound * 0.8,
                                      outer_radius=space_bound),
            animators=ani,
            evolution_method="SO",
        ).to_sim()

        print(sim.info())

        si.vis.xy_plot(
            "fsw_potential",
            sim.mesh.x_mesh,
        ide_shared_kwargs = dict(evolution_method="RK4", time_step=1 * asec)

        msh_spec = ion.LineSpecification(
            "msh",
            time_step=1 * asec,
            x_bound=200 * bohr_radius,
            x_points=2**10,
            internal_potential=gaussian_well,
            initial_state=variational_ground_state,
            use_numeric_eigenstates=True,
            numeric_eigenstate_max_energy=20 * eV,
            analytic_eigenstate_type=ion.GaussianWellState,
            mask=ion.RadialCosineMask(inner_radius=175 * bohr_radius,
                                      outer_radius=200 * bohr_radius),
            animators=[
                animation.animators.RectangleSplitLowerAnimator(
                    postfix="__g2",
                    axman_wavefunction=animation.animators.LineMeshAxis(),
                    axman_lower_left=animation.animators.
                    ElectricPotentialPlotAxis(show_vector_potential=False),
                    axman_lower_right=animation.animators.
                    WavefunctionStackplotAxis(
                        states=[variational_ground_state]),
                    fig_dpi_scale=1,
                    target_dir=OUT_DIR,
                )
            ],
            **shared_kwargs,
        )
        len_spec = ide.IntegroDifferentialEquationSpecification(
            "ide_len",
예제 #3
0
            x_label=r"$x$",
            x_unit="bohr_radius",
            y_label=r"$V(x)$",
            y_unit="eV",
            **PLOT_KWARGS,
        )

        sim = ion.LineSpecification(
            "gaussian_well",
            x_bound=100 * bohr_radius,
            x_points=2**10,
            test_mass=electron_mass,
            internal_potential=gaussian_well,
            initial_state=variational_ground_state,
            use_numeric_eigenstates=True,
            analytic_eigenstate_type=ion.GaussianWellState,
            time_initial=0,
            time_final=1 * fsec,
            animators=[
                animation.animators.RectangleAnimator(
                    axman_wavefunction=animation.animators.LineMeshAxis(),
                    target_dir=OUT_DIR,
                )
            ],
        ).to_sim()

        sim.info().log()

        numeric_ground_state = sim.spec.test_states[0]

        si.vis.xy_plot(
            "ground_state_comparison",
예제 #4
0
            pot, mass, n=1) + ion.QHOState.from_potential(pot, mass, n=2)

        animators = [
            src.ionization.animators.LineAnimator(postfix="_nm",
                                                  target_dir=OUT_DIR,
                                                  distance_unit="nm"),
            src.ionization.animators.LineAnimator(postfix="_br",
                                                  target_dir=OUT_DIR,
                                                  distance_unit="bohr_radius"),
        ]
        specs.append(
            ion.LineSpecification(
                "line",
                x_bound=50 * nm,
                x_points=2**14,
                internal_potential=pot,
                electric_potential=ion.SineWave.from_photon_energy(
                    1 * eV, amplitude=0.05 * atomic_electric_field),
                test_states=(ion.QHOState.from_potential(pot, mass, n=n)
                             for n in range(20)),
                initial_state=init,
                time_initial=t_init * asec,
                time_final=t_final * 10 * asec,
                time_step=dt * asec,
                mask=ion.RadialCosineMask(inner_radius=40 * nm,
                                          outer_radius=50 * nm),
                animators=animators,
            ))

        si.utils.multi_map(make_movie, specs, processes=4)
예제 #5
0
                    ),
                    show_norm=False,
                    legend_kwargs={"fontsize": 12},
                ),
                **ANIM_KWARGS,
            )
        ]

        sim = ion.LineSpecification(
            "truncated_qho",
            x_bound=50 * bohr_radius,
            x_points=2 ** 13,
            internal_potential=truncated_qho_pot,
            electric_potential=efield,
            test_mass=mass,
            # use_numeric_eigenstates = True,
            # numeric_eigenstate_max_energy = 10 * eV,
            # analytic_eigenstate_type = ion.QHOState,
            initial_state=init,
            time_initial=0,
            time_final=efield.period_carrier * 10,
            time_step=10 * asec,
            animators=animators,
        ).to_sim()

        sim.info().log()

        si.vis.xy_plot(
            "truncated_qho_potential",
            sim.mesh.x_mesh,
            truncated_qho_pot(distance=sim.mesh.x_mesh),
            x_label=r"$x$",
예제 #6
0
        spec = ion.LineSpecification(
            f"LR__cep={phase / pi:3f}pi_{num_states}",
            internal_potential=ion.SoftCoulomb(),
            electric_potential=pulse,
            initial_state=ion.OneDSoftCoulombState(),
            x_bound=3400 * bohr_radius,
            x_points=17000,
            time_initial=0,
            time_final=time_final,
            time_step=0.02 * atomic_time,
            use_numeric_eigenstates=True,
            number_of_numeric_eigenstates=num_states,
            analytic_eigenstate_type=ion.OneDSoftCoulombState,
            # checkpoints = True,
            # checkpoint_every = datetime.timedelta(minutes = 1),
            # checkpoint_dir = SIM_LIB,
            # animators = [
            #     ion.animators.RectangleAnimator(
            #         axman_wavefunction = ion.animators.LineMeshAxis(
            #             which = 'fft',
            #             log = True,
            #             distance_unit = 'per_nm',
            #             # plot_limit = 1000 * per_nm,
            #         ),
            #         fig_dpi_scale = 2,
            #         length = 30,
            #         target_dir = OUT_DIR,
            #     ),
            # ]
        )
예제 #7
0
                                                  postfix="_full_log",
                                                  log_metrics=True),
            src.ionization.animators.LineAnimator(target_dir=OUT_DIR,
                                                  plot_limit=10 * nm,
                                                  postfix="_10"),
        ]

        sim = ion.LineSpecification(
            "qho",
            x_bound=50 * nm,
            x_points=2**14,
            internal_potential=pot,
            # internal_potential = ion.NoPotentialEnergy(),
            electric_potential=electric,
            test_mass=mass,
            test_states=(ion.QHOState.from_potential(pot, mass, n=n)
                         for n in range(60)),
            dipole_gauges=(),
            initial_state=init,
            time_initial=0,
            time_final=10 * fsec,
            time_step=10 * asec,
            animators=ani,
        ).to_sim()

        # delta = 2 * bohr_radius
        # sim.mesh.psi = np.exp(-0.5 * ((sim.mesh.x / delta) ** 2)).astype(np.complex128)

        print("init norm", sim.mesh.norm())

        sim.mesh.plot_g2(name_postfix="_init", target_dir=OUT_DIR)
예제 #8
0
                checkpoint_dir=SIM_LIB,
                store_data_every=1,
            )

            prefix = (
                f"pw={pw / asec:2f}as_flu={flu / Jcm2:4f}jcm2_phase={phase / pi:3f}pi"
            )

            fsw_initial_state = ion.FiniteSquareWellState.from_potential(
                internal_potential, mass=test_mass)

            specs = [
                ion.LineSpecification(
                    prefix + "__fsw_len",
                    internal_potential=internal_potential,
                    initial_state=fsw_initial_state,
                    evolution_gauge="LEN",
                    **shared_kwargs,
                ),
                # ion.LineSpecification(
                #     prefix + '__line_vel',
                #     internal_potential = internal_potential,
                #     initial_state = ion.FiniteSquareWellState.from_potential(internal_potential, mass = test_mass),
                #     evolution_gauge = 'VEL',
                #     **shared_kwargs,
                # ),
                ion.SphericalHarmonicSpecification(prefix + "__hyd_len",
                                                   evolution_gauge="LEN",
                                                   **shared_kwargs),
                # ion.SphericalHarmonicSpecification(
                #     prefix + '__hyd_vel',
                    target_dir=OUT_DIR,
                    axman_wavefunction=animation.animators.LineMeshAxis(
                        norm=si.vis.AbsoluteRenormalize()),
                    axman_lower=animation.animators.ElectricPotentialPlotAxis(
                        show_vector_potential=True),
                )
            ],
        )

        specs = []

        for gauge in ("LEN", "VEL"):
            specs.append(
                ion.LineSpecification(
                    f"{gauge}",
                    **line_spec_base,
                    evolution_gauge=gauge,
                    dipole_gauges=("LEN", ),
                ))

    results = si.utils.multi_map(run_sim, specs)

    for r in results:
        print(r.electric_dipole_moment_expectation_value_vs_time)

    si.vis.xxyy_plot(
        "dipole_moment",
        (r.data_times for r in results),
        (r.electric_dipole_moment_expectation_value_vs_time for r in results),
        line_labels=(r.name for r in results),
        line_kwargs=({
            "linestyle": "-"
예제 #10
0
                epsilon=1e-6,
                analytic_eigenstate_type=ion.QHOState,
                checkpoints=True,
                checkpoint_dir=SIM_LIB,
            )

            prefix = (
                f"pw={pw / asec:2f}as_flu={flu / Jcm2:4f}jcm2_phase={phase / pi:3f}pi"
            )

            specs = [
                ion.LineSpecification(
                    prefix + "__line_len",
                    internal_potential=internal_potential,
                    initial_state=ion.QHOState.from_potential(
                        internal_potential, mass=test_mass),
                    store_data_every=5,
                    evolution_gauge="LEN",
                    **shared_kwargs,
                ),
                ion.LineSpecification(
                    prefix + "__line_vel",
                    internal_potential=internal_potential,
                    initial_state=ion.QHOState.from_potential(
                        internal_potential, mass=test_mass),
                    store_data_every=5,
                    evolution_gauge="VEL",
                    **shared_kwargs,
                ),
                ide.IntegroDifferentialEquationSpecification(
                    prefix + "__ide_len",
                    round(depth, 2),
                    round(width, 2),
                    x_bound,
                    x_points_exp,
                    time_bound,
                    dt,
                ))

            specs.append(
                ion.LineSpecification(
                    identifier,
                    x_bound=x_bound * nm,
                    x_points=2**x_points_exp,
                    internal_potential=fsw_potential,
                    test_mass=mass,
                    test_states=test_states,
                    dipole_gauges=(),
                    initial_state=init,
                    time_initial=0,
                    time_final=time_bound * asec,
                    time_step=dt * asec,
                    fft_cutoff_energy=500 * eV,
                ))

        sims = si.utils.multi_map(run, specs, processes=2)

        times = sims[0].times
        energy_expectation_value = [
            sim.energy_expectation_value_vs_time_internal for sim in sims
        ]
        energy_expectation_value_error = [
            np.abs(sim.energy_expectation_value_vs_time_internal -
예제 #12
0
                            for n in range(4)),
                    show_norm=False,
                    legend_kwargs={"fontsize": 12},
                ),
                **anim_kwargs,
            ),
        ]

        sim = ion.LineSpecification(
            "line",
            time_initial=0 * asec,
            time_final=300 * asec,
            x_bound=100 * bohr_radius,
            x_points=2**10,
            internal_potential=pot,
            initial_state=ion.QHOState.from_potential(pot, mass=electron_mass),
            test_states=(ion.QHOState.from_potential(pot,
                                                     mass=electron_mass,
                                                     n=n) for n in range(50)),
            electric_potential=ion.potentials.Rectangle(
                start_time=100 * asec,
                end_time=150 * asec,
                amplitude=0.1 * atomic_electric_field,
            ),
            animators=animators,
        ).to_sim()

        sim.info().log()
        sim.run()
        sim.info().log()