floquet_toolkit is a reusable Python framework for numerical Floquet calculations in driven two-band Bloch systems, with built-in examples centered on driven Dirac and graphene-style models.
It currently provides tools to:
- build truncated extended space Floquet Hamiltonians from time-periodic models
- diagonalize Floquet Hamiltonians and reconstruct time-dependent Floquet states
- compute quasienergy spectra
- compute Berry curvature from static, Floquet, perturbative Floquet, and high-frequency effective descriptions
- compute current observables for several state constructions
- work with built-in driven Dirac and graphene-style model factories
The package is designed to avoid rewriting model-specific or observable-specific code for each new study. New driven two-band systems can be introduced through the DrivenBlochHamiltonian abstraction, while new observables can be built on top of the existing Floquet builders and calculator infrastructure. In practice, this means users can reuse the same numerical machinery across different models and extend the toolkit with new calculators instead of rewiring the full codebase.
floquet-toolkit/
floquet_toolkit/
builtin_models/
builders/
calculators/
core/
config.py
managers/
tests/
examples/
pyproject.toml
Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pipInstall the package in editable mode:
pip install -e .Install optional plotting and test dependencies:
pip install -e ".[plots,dev]"Dependency groups:
plots: installsmatplotlibdev: installspytest
FloquetLocalManager handles local-in-momentum observables such as spectra,
Floquet states, Berry curvature, and velocities. FloquetTransportManager
collects loop/integrated transport-style observables such as Berry phases.
FloquetManager remains available as a lightweight compatibility wrapper that
exposes .local and .transport.
Useful methods are grouped roughly as follows:
-
State and spectrum
diagonalize_floquet_hamiltonianselect_floquet_statecompute_floquet_spectrum
-
Berry curvature
compute_static_berry_curvaturecompute_instantaneous_berry_curvaturecompute_perturbed_state_berry_curvature
-
Velocity observables
compute_floquet_velocitycompute_static_velocitycompute_adiabatic_velocity
Additional helper methods are also available for perturbative and high-frequency calculations, but the methods above are the most common starting points for users of the package.
The package currently includes:
DiracModelGrapheneModelRotatingFrameDiracModel
Each built-in model class can be converted into a solver-facing
DrivenBlochHamiltonian with .to_driven_hamiltonian(). Convenience factory
helpers are also available:
driven_dirac_model(...)driven_graphene_model(...)rotating_frame_dirac_model(...)
Users are not limited to the built-in models. You can define your own time-periodic two-band Hamiltonian with the DrivenBlochHamiltonian class and then reuse the same Floquet builders, calculators, and FloquetManager interface.
Shared configuration lives in floquet_toolkit.config:
DriveParametersFloquetParameters
Model-specific physical parameters live in floquet_toolkit.builtin_models:
DiracParametersGrapheneParameters
The examples/ folder contains lightweight plotting examples for the built-in models. Current examples include:
examples/plot_spectra.pyandexamples/plot_spectra.ipynbfor Dirac and graphene Floquet spectrum visualizationsexamples/plot_dirac_curvature_vs_amplitude.pyandexamples/plot_dirac_curvature_vs_amplitude.ipynbfor scanning the time-averaged Dirac-model curvature atk=(0,0)versus circular-drive amplitude
Run the current test suite with:
pytest -q tests/test_floquet_builder.py tests/test_curvature_convergence.pyThe current tests cover:
- Floquet-builder convergence with respect to
n_trunc,n_harmonics, andn_time - matrix-size and eigensystem consistency
dkconvergence for instantaneous Berry curvaturedkconvergence for numerically computed static Berry curvature
import numpy as np
from floquet_toolkit import DiracModel, FloquetLocalManager, UnitConvention
from floquet_toolkit.builtin_models import DiracParameters
from floquet_toolkit.config import (
DriveParameters,
FloquetParameters,
MEV_TO_J,
)
si_units = UnitConvention.SI_UNITS()
dirac_params = DiracParameters(
units=si_units,
vf=1.0e6,
mass=-40.0 * MEV_TO_J,
)
drive_params = DriveParameters(
units=si_units,
AL=3.0e-9,
AR=0.0,
)
floquet_params = FloquetParameters(
n_trunc=5,
n_harmonics=2,
n_time=61,
)
model = DiracModel(dirac_params, drive_params).to_driven_hamiltonian()
manager = FloquetLocalManager(model, floquet_params)
time = np.linspace(0.0, drive_params.period, floquet_params.n_time, endpoint=False)
curvature = manager.compute_instantaneous_berry_curvature(
time=time,
kx=0.0,
ky=0.0,
band="conduction",
dk=1.0e5,
)
print(curvature.shape)