Skip to content

plao12/Quantum-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantum-Simulator

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).

Features

Repository layout (key files)

  • 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

Quick start (Julia REPL)

  1. Start Julia in the project root.
  2. 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)

Examples and visualization

  • Interactive examples and plots are in usage_examples.ipynb. Plots call the simulation results and the plotting helpers in the notebook.

Notes

  • GPU code is conditional on CUDA availability; the project checks CUDA at runtime and falls back to CPU if unavailable. See common/caller.jl and runner.jl for dispatch logic.
  • Greens-function modules export main_computation (or main_computation! for GPU). See the per-level files in src/.

Installation

Requirements

  • Julia (recommended 1.8+)
  • Git
  • For GPU support: an NVIDIA GPU with compatible drivers and the CUDA toolkit installed (system-level).

Linux

  1. Install system dependencies (example for Debian/Ubuntu):
    sudo apt update
    sudo apt install -y build-essential git wget ca-certificates
  2. Install Julia (recommended: official binaries):
    # 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
    Option: use your distro package manager but official binaries are recommended for up-to-date releases.
  3. (Optional) GPU support — install NVIDIA drivers and CUDA following your distribution instructions. Verify drivers:
    nvidia-smi
  4. 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()'
  5. Verify CUDA from Julia (if using GPU):
    julia --project=. -e 'using Pkg; Pkg.add("CUDA"); using CUDA; println(CUDA.has_cuda()); CUDA.versioninfo()'

Windows

  1. Install Git and Julia:
  2. (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-smi from an elevated PowerShell or Command Prompt.
    • If using WSL2: follow NVIDIA and Microsoft instructions to enable CUDA in WSL2.
  3. 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()'
  4. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published