Пример #1
0
    def info(self) -> si.Info:
        info = super().info()

        info_mesh = si.Info(header=f"Mesh: {self.mesh_type.__name__}")
        info_mesh.add_field(
            "Z Boundary", utils.fmt_quantity(self.z_bound, utils.LENGTH_UNITS)
        )
        info_mesh.add_field("Z Points", self.z_points)
        info_mesh.add_field(
            "Z Mesh Spacing",
            utils.fmt_quantity(2 * self.z_bound / self.z_points, utils.LENGTH_UNITS),
        )

        info.add_info(info_mesh)

        info_eigenstates = si.Info(
            header=f"Numeric Eigenstates: {self.use_numeric_eigenstates}"
        )
        if self.use_numeric_eigenstates:
            info_eigenstates.add_field(
                "Number of Numeric Eigenstates", self.number_of_numeric_eigenstates
            )

        info.add_info(info_eigenstates)

        return info
Пример #2
0
    def info(self) -> si.Info:
        info = super().info()

        info_evolution = si.Info(header="Time Evolution")
        info_evolution.add_field("Initial Time",
                                 f"{self.time_initial / u.asec:3f} as")
        info_evolution.add_field("Final Time",
                                 f"{self.time_final / u.asec:3f} as")

        info.add_info(info_evolution)

        info_algorithm = si.Info(header="Evolution Algorithm")
        info_algorithm.add_field("Evolution Gauge", self.evolution_gauge)

        info.add_info(info_algorithm)

        info_ide = si.Info(header="IDE Parameters")
        info_ide.add_field("Initial State", f"a = {self.b_initial}")
        info_ide.add_field("Prefactor", self.integral_prefactor)
        info_ide.add_info(self.kernel.info())
        info_ide.add_field(
            "DC Correct Electric Field",
            "yes" if self.electric_potential_dc_correction else "no",
        )

        info_potential = self.electric_potential.info()
        info_potential.header = "Electric Potential: " + info_potential.header
        info_ide.add_info(info_potential)

        info.add_info(info_ide)

        return info
Пример #3
0
    def info(self) -> si.Info:
        info = super().info()

        info_mesh = si.Info(header=f"Mesh: {self.mesh_type.__name__}")
        info_mesh.add_field(
            "R Boundary", utils.fmt_quantity(self.r_bound, utils.LENGTH_UNITS)
        )
        info_mesh.add_field("R Points", self.r_points)
        info_mesh.add_field(
            "R Mesh Spacing",
            utils.fmt_quantity(self.r_bound / self.r_points, utils.LENGTH_UNITS),
        )
        info_mesh.add_field("L Bound", self.l_bound)
        info_mesh.add_field("Total Mesh Points", self.r_points * self.l_bound)

        info.add_info(info_mesh)

        info_eigenstates = si.Info(
            header=f"Numeric Eigenstates: {self.use_numeric_eigenstates}"
        )
        if self.use_numeric_eigenstates:
            info_eigenstates.add_field(
                "Max Energy",
                utils.fmt_quantity(
                    self.numeric_eigenstate_max_energy, utils.ENERGY_UNITS
                ),
            )
            info_eigenstates.add_field(
                "Max Angular Momentum", self.numeric_eigenstate_max_angular_momentum
            )

        info.add_info(info_eigenstates)

        return info
Пример #4
0
    def info(self) -> si.Info:
        info = super().info()

        info_evolution = si.Info(header="Time Evolution")
        info_evolution.add_field(
            "Initial Time",
            utils.fmt_quantity(self.time_initial, utils.TIME_UNITS))
        info_evolution.add_field(
            "Final Time", utils.fmt_quantity(self.time_final,
                                             utils.TIME_UNITS))
        info_evolution.add_field(
            "Time Step", utils.fmt_quantity(self.time_step, utils.TIME_UNITS))

        info.add_info(info_evolution)

        info.add_info(self.tunneling_model.info())

        info.add_field("Initial b", self.b_initial)

        info_fields = si.Info(header="Electric Fields")
        info_fields.add_field(
            "DC Correct Electric Field",
            "yes" if self.electric_potential_dc_correction else "no",
        )
        for x in self.electric_potential:
            info_fields.add_info(x.info())
        info.add_info(info_fields)

        return info
Пример #5
0
    def info(self) -> si.Info:
        info = super().info()

        info_checkpoint = si.Info(header="Checkpointing")
        if self.checkpoints:
            if self.checkpoint_dir is not None:
                working_in = self.checkpoint_dir
            else:
                working_in = "cwd"
            info_checkpoint.header += ": every {} time steps, working in {}".format(
                self.checkpoint_every, working_in)
        else:
            info_checkpoint.header += ": disabled"

        info.add_info(info_checkpoint)

        info_evolution = si.Info(header="Time Evolution")
        info_evolution.add_field(
            "Initial Time",
            utils.fmt_quantity(self.time_initial, utils.TIME_UNITS))
        info_evolution.add_field(
            "Final Time", utils.fmt_quantity(self.time_final,
                                             utils.TIME_UNITS))
        info_evolution.add_field(
            "Time Step", utils.fmt_quantity(self.time_step, utils.TIME_UNITS))
        info.add_info(info_evolution)

        info_algorithm = si.Info(header="Evolution Algorithm")
        info_algorithm.add_field("Integration Method", self.integration_method)
        info_algorithm.add_info(self.evolution_method.info())
        info_algorithm.add_field("Evolution Gauge", self.evolution_gauge)
        info.add_info(info_algorithm)

        info_ide = si.Info(header="IDE Parameters")
        info_ide.add_field("Initial State", f"b = {self.b_initial}")
        info_ide.add_field("Prefactor", self.integral_prefactor)
        info.add_info(info_ide)

        info.add_info(self.kernel.info())
        info.add_info(self.tunneling_model.info())

        info_fields = si.Info(header="Electric Fields")
        info_fields.add_field(
            "DC Correct Electric Field",
            "yes" if self.electric_potential_dc_correction else "no",
        )
        for x in itertools.chain(self.electric_potential):
            info_fields.add_info(x.info())
        info.add_info(info_fields)

        return info
Пример #6
0
    def info(self) -> si.Info:
        info = super().info()

        info_mesh = si.Info(header=f"Mesh: {self.mesh_type.__name__}")
        info_mesh.add_field(
            "R Boundary", utils.fmt_quantity(self.r_bound, utils.LENGTH_UNITS)
        )
        info_mesh.add_field("R Points", self.r_points)
        info_mesh.add_field(
            "R Mesh Spacing",
            utils.fmt_quantity(self.r_bound / self.r_points, utils.LENGTH_UNITS),
        )
        info_mesh.add_field("Theta Points", self.theta_points)
        info_mesh.add_field(
            "Theta Mesh Spacing",
            utils.fmt_quantity(u.pi / self.theta_points, utils.ANGLE_UNITS),
        )
        info_mesh.add_field(
            "Maximum Adjacent-Point Spacing",
            utils.fmt_quantity(
                u.pi * self.r_bound / self.theta_points, utils.LENGTH_UNITS
            ),
        )
        info_mesh.add_field("Total Mesh Points", int(self.r_points * self.theta_points))

        info.add_info(info_mesh)

        return info
Пример #7
0
    def info(self) -> si.Info:
        info = super().info()

        info_mesh = si.Info(header=f"Mesh: {self.mesh_type.__name__}")
        info_mesh.add_field(
            "Z Boundary", utils.fmt_quantity(self.z_bound, utils.LENGTH_UNITS)
        )
        info_mesh.add_field("Z Points", self.z_points)
        info_mesh.add_field(
            "Z Mesh Spacing",
            utils.fmt_quantity(2 * self.z_bound / self.z_points, utils.LENGTH_UNITS),
        )
        info_mesh.add_field(
            "Rho Boundary", utils.fmt_quantity(self.rho_bound, utils.LENGTH_UNITS)
        )
        info_mesh.add_field("Rho Points", self.rho_points)
        info_mesh.add_field(
            "Rho Mesh Spacing",
            utils.fmt_quantity(self.rho_bound / self.rho_points, utils.LENGTH_UNITS),
        )
        info_mesh.add_field("Total Mesh Points", int(self.z_points * self.rho_points))

        info.add_info(info_mesh)

        return info
Пример #8
0
    def info(self) -> si.Info:
        info = si.Info(
            header=
            f"{self.__class__.__name__}(amplitude = {np.around(self.amplitude, 3)}, norm = {np.around(self.norm, 3)})"
        )

        return info
Пример #9
0
    def info(self) -> si.Info:
        info = si.Info(header=self.__class__.__name__)

        info.add_field(
            "Upper Electric Field Amplitude Cutoff",
            utils.fmt_quantity(self.upper_amplitude_cutoff,
                               utils.ELECTRIC_FIELD_UNITS),
        )

        return info
Пример #10
0
    def info(self) -> si.Info:
        info = super().info()

        mem_mesh = self.mesh.g.nbytes if self.mesh is not None else 0

        mem_matrix_operators = 6 * mem_mesh
        mem_numeric_eigenstates = sum(
            state.g.nbytes
            for state in self.spec.test_states
            if state.numeric and state.g is not None
        )

        mem_misc = sum(
            x.nbytes
            for x in (self.times, self.data_times, self.data_mask, self.data_indices)
        )

        mem_total = sum(
            (mem_mesh, mem_matrix_operators, mem_numeric_eigenstates, mem_misc)
        )

        info_mem = si.Info(
            header=f"Memory Usage (approx.): {si.utils.bytes_to_str(mem_total)}"
        )
        info_mem.add_field("g", si.utils.bytes_to_str(mem_mesh))
        info_mem.add_field(
            "Matrix Operators", si.utils.bytes_to_str(mem_matrix_operators)
        )
        if (
            hasattr(self.spec, "use_numeric_eigenstates")
            and self.spec.use_numeric_eigenstates
        ):
            info_mem.add_field(
                "Numeric Eigenstates", si.utils.bytes_to_str(mem_numeric_eigenstates)
            )
        info_mem.add_fields(
            (ds_type.__name__, si.utils.bytes_to_str(sys.getsizeof(ds)))
            for ds_type, ds in self.datastores_by_type.items()
        )
        info_mem.add_field("Miscellaneous", si.utils.bytes_to_str(mem_misc))

        info.add_info(info_mem)

        return info
Пример #11
0
    def info(self) -> si.Info:
        info = super().info()

        info_checkpoint = si.Info(header="Checkpointing")
        if self.checkpoints:
            if self.checkpoint_dir is not None:
                working_in = self.checkpoint_dir
            else:
                working_in = "cwd"
            info_checkpoint.header += (
                f": every {self.checkpoint_every} time steps, working in {working_in}"
            )
        else:
            info_checkpoint.header += ": disabled"

        info.add_info(info_checkpoint)

        info_animation = si.Info(header="Animation")
        if len(self.animators) > 0:
            for animator in self.animators:
                info_animation.add_info(animator.info())
        else:
            info_animation.header += ": none"
        info.add_info(info_animation)

        info_evolution = si.Info(header="Time Evolution")
        info_evolution.add_field("Initial State", str(self.initial_state))
        info_evolution.add_field(
            "Initial Time", utils.fmt_quantity(self.time_initial, utils.TIME_UNITS)
        )
        info_evolution.add_field(
            "Final Time", utils.fmt_quantity(self.time_final, utils.TIME_UNITS)
        )
        if not callable(self.time_step):
            info_evolution.add_field(
                "Time Step", utils.fmt_quantity(self.time_step, utils.TIME_UNITS)
            )
        else:
            info_evolution.add_field("Time Step", f"determined by {self.time_step}")
        info.add_info(info_evolution)

        info_algorithm = si.Info(header="Operators and Evolution Algorithm")
        info_algorithm.add_info(self.operators.info())
        info_algorithm.add_info(self.evolution_method.info())
        info.add_info(info_algorithm)

        info_potentials = si.Info(header="Potentials and Masks")
        info_potentials.add_field(
            "DC Correct Electric Field",
            "yes" if self.electric_potential_dc_correction else "no",
        )
        for x in itertools.chain(
            self.internal_potential, self.electric_potential, self.mask
        ):
            info_potentials.add_info(x.info())
        info.add_info(info_potentials)

        info_analysis = si.Info(header="Analysis")

        info_test_particle = si.Info(header="Test Particle")
        info_test_particle.add_field(
            "Charge", utils.fmt_quantity(self.test_charge, utils.CHARGE_UNITS)
        )
        info_test_particle.add_field(
            "Mass", utils.fmt_quantity(self.test_mass, utils.MASS_UNITS)
        )
        info_analysis.add_info(info_test_particle)

        if len(self.test_states) > 10:
            info_analysis.add_field(
                f"Test States (first 5 of {len(self.test_states)})",
                ", ".join(str(s) for s in sorted(self.test_states)[:5]),
            )
        else:
            info_analysis.add_field(
                "Test States", ", ".join(str(s) for s in sorted(self.test_states))
            )
        info_analysis.add_field(
            "Datastore Types", ", ".join(ds.__name__ for ds in self.datastore_types)
        )
        info_analysis.add_field("Data Storage Decimation", self.store_data_every)
        info_analysis.add_field(
            "Snapshot Indices",
            ", ".join(sorted(self.snapshot_indices))
            if len(self.snapshot_indices) > 0
            else "none",
        )
        info_analysis.add_field(
            "Snapshot Times",
            (f"{st / u.asec:.3f} as" for st in self.snapshot_times)
            if len(self.snapshot_times) > 0
            else "none",
        )
        info.add_info(info_analysis)

        return info
Пример #12
0
    def info(self) -> si.Info:
        info = si.Info(header=self.__class__.__name__)

        return info
Пример #13
0
    def info(self) -> si.Info:
        info = si.Info(header=f"Evolution Method: {self.__class__.__name__}")

        info.add_field("Time Step Type", self.time_step_type.value.title())

        return info