A Julia-based simulator for quantum molecular junctions: models of one-to-three molecular levels connected to two leads (left/right). Implements Green's function-based spectral and transport calculations on CPU and optional GPU backends, plus common interaction kernels (Heisenberg, Ising, anisotropy, Dzyaloshinskii–Moriya).
- Green's-function solvers for single-, two- and three-level models (CPU and GPU variants). See implementations:
- Interaction kernels (CPU):
Heisenberg.heisenberg!,Ising.ising!,UniaxialAnisotropy.anisotropy!,DzyaloshinskiiMoriya.dzyaloshinskii_moriya!— NOTE: Dzyaloshinskii–Moriya kernel file is present but not yet activated/functional. - Quantum statistics helpers:
QuantumStatistics.bose_einstein_d,QuantumStatistics.fermi_dirac_d - Modular launcher + runner:
- Project entry & helpers:
Launcher - Simulation runner:
Runner.run_simulation - Interaction caller:
InteractionCaller.init_interactions - Greens-function caller:
GreensCaller
- Project entry & helpers:
- launcher.jl — project entry, model selection, parameter setup
- runner.jl — execution loop, CPU/GPU dispatch
- common/ — shared interaction and utilities (CPU/GPU)
- src/ — greens-function implementations per device/level
- usage_examples.ipynb — example workflows and plots
- images/ — SVG illustrations used in examples
- Start Julia in the project root.
- Run:
include("launcher.jl")
using .Launcher
model = Launcher.init_model(device="cpu", level=1, U_interaction=false)
data, indexes = Launcher.init_parameters_simulation(
model;
parameters=(Tr=(3.0,), U=(0.0,), λ=(0.5,), eV=(-10.0,), ϵ=(0.0,)),
E=(start=-10.0, stop=10.0, length=500)
)
Launcher.run_simulation(model, data, indexes)- Interactive examples and plots are in usage_examples.ipynb. Plots call the simulation results and the plotting helpers in the notebook.
- GPU code is conditional on CUDA availability; the project checks CUDA at runtime and falls back to CPU if unavailable. See
common/caller.jlandrunner.jlfor dispatch logic. - Greens-function modules export
main_computation(ormain_computation!for GPU). See the per-level files in src/.
Requirements
- Julia (recommended 1.8+)
- Git
- For GPU support: an NVIDIA GPU with compatible drivers and the CUDA toolkit installed (system-level).
Linux
- Install system dependencies (example for Debian/Ubuntu):
sudo apt update sudo apt install -y build-essential git wget ca-certificates
- Install Julia (recommended: official binaries):
Option: use your distro package manager but official binaries are recommended for up-to-date releases.
# download latest stable tarball, adjust version as needed wget https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.x-linux-x86_64.tar.gz tar -xzf julia-1.10.*.tar.gz sudo mv julia-1.10.* /opt/julia-1.10 sudo ln -s /opt/julia-1.10/bin/julia /usr/local/bin/julia
- (Optional) GPU support — install NVIDIA drivers and CUDA following your distribution instructions. Verify drivers:
nvidia-smi
- Clone and instantiate the project:
git clone https://github.com/plao12/Quantum-Simulator cd Quantum-Simulator julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()'
- Verify CUDA from Julia (if using GPU):
julia --project=. -e 'using Pkg; Pkg.add("CUDA"); using CUDA; println(CUDA.has_cuda()); CUDA.versioninfo()'
Windows
- Install Git and Julia:
- Download and run the Julia installer from https://julialang.org/downloads/ and check "Add Julia to PATH" during installation.
- Install Git (https://git-scm.com/) or via Chocolatey:
choco install git.
- (Optional) GPU support — install NVIDIA drivers and the CUDA toolkit from NVIDIA. On Windows, ensure the driver and toolkit versions are compatible.
- Verify with
nvidia-smifrom an elevated PowerShell or Command Prompt. - If using WSL2: follow NVIDIA and Microsoft instructions to enable CUDA in WSL2.
- Verify with
- Clone and instantiate the project (PowerShell or Git Bash):
git clone https://github.com/plao12/Quantum-Simulator cd Quantum-Simulator julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()'
- Verify CUDA in Julia:
julia --project=. -e "using Pkg; Pkg.add(\"CUDA\"); using CUDA; println(CUDA.has_cuda()); CUDA.versioninfo()"
Quick start (project)
- After installation, run examples from the Quick start section:
include("launcher.jl") using .Launcher # ...example usage...
Troubleshooting
- If package instantiation fails, run in the Julia REPL:
using Pkg Pkg.instantiate() Pkg.resolve() Pkg.precompile()
- For GPU issues, ensure system CUDA and driver versions match the requirements of CUDA.jl. Use
CUDA.versioninfo()for diagnostics. - On Windows, if building native packages fails, ensure required build tools (MSVC/Build Tools) are installed.