SUMMARY
pyqula is a Python library for quantum lattice tight-binding models, in zero to three dimensions. With it we compute band structures, spectral functions, self-consistent mean-field states, superconductivity, topological invariants, response functions and quantum transport.
The user guide is at https://joselado.github.io/pyqula/. It has one page per
topic (Hamiltonians, spectral functions, superconductivity, mean field,
topology, response functions, transport, Wannierization, KPM, classical spin
and lattice-gas models), each with the formula, the physical meaning, runnable
code and computed figures, and a reference of the Geometry and Hamiltonian
methods and their arguments. The whole guide is also available as one
PDF.
INSTALLATION
With pip (release version)
pip install --upgrade pyqula
Manual installation (most recent version)
To use the newest version, clone the GitHub repository
git clone https://github.com/joselado/pyqula
and add its src folder to the Python path of your script
import sys
sys.path.append(PATH_TO_PYQULA+"/src")
Optional dependencies
A few features need libraries that are not installed by default. They come with these extras:
pip install pyqula[mpi] # MPI-parallel routines (mpi4py)
pip install pyqula[dataframe] # pandas-based data export
pip install pyqula[images] # Pillow-based image export
pip install pyqula[all] # all of the above
Recommended library versions
pyqula needs at least these versions, and pyproject.toml enforces them:
- numpy >= 2.1
- scipy >= 1.13.1
- matplotlib >= 3.10.0
- numba >= 0.60.0
- multiprocess >= 0.70.19
- dill >= 0.4.1
- threadpoolctl >= 3.5.0
- jax >= 0.8.1
Documentation
examples/ contains several hundred runnable scripts, ordered by dimension
(0d/ 1d/ 2d/ 3d/) and by topic (transport/, embedding/, wannier/,
classicalspin/, latticegas/ and others).
Tutorials
These Jupyter notebooks are tutorials that use pyqula.
In this repository:
jupyter-notebooks/: eleven notebooks, step by step, from the lattice and its band structure to self-consistent calculations, Chern insulators, Jackiw-Rebbi solitons and the modes of a quantum dotjupyter-notebooks/functionalities/: one executed notebook for each entry of the FUNCTIONALITIES list below
From the "Advanced Quantum Materials course at Aalto University 2025"
- Electronic structure theory
- Topological band structure theory
- The Quantum Hall state
- Superconductivity and Majorana physics
- Interactions and magnetism
- Excitations and defects in quantum materials
From the Jyvaskyla Summer School 2022
FUNCTIONALITIES
Single particle Hamiltonians
- Spinless, spinful and Nambu basis for orbitals [notebook]
- Full non-collinear electron and Nambu formalism [notebook]
- Include magnetism, spin-orbit coupling and superconductivity [notebook]
- Band structures with state-resolved expectation values [notebook]
- Momentum-resolved spectral functions [notebook]
- Local and full operator-resolved density of states [notebook]
- 0d, 1d, 2d and 3d tight binding models [notebook]
- Electronic structure unfolding in supercells [notebook]
- Non-Hermitian Hamiltonians [notebook]
- Structural relaxation of twisted bilayer graphene [notebook]
- Spin splitting of collinear magnets and altermagnets [notebook]
- Nonlinear spin conductivity and the X-wave index of altermagnets [notebook]
- Three-band model of transition metal dichalcogenides [notebook]
- Ultra long-range modulations of the electronic structure [notebook]
Interacting mean-field Hamiltonians
- Selfconsistent mean-field calculations with local/non-local interactions [notebook]
- Both collinear and non-collinear formalism [notebook]
- Spin-spin exchange mean field, including anisotropic exchange [notebook]
- Anomalous mean-field for non-collinear superconductors [notebook]
- Full selfconsistency with all Wick terms for non-collinear superconductors [notebook]
- Constrained and unconstrained mean-field calculations [notebook]
- Automatic identification of order parameters for symmetry broken states [notebook]
- Hermitian and non-Hermitian mean-field calculations [notebook]
- Random phase approximation many-body response functions [notebook]
- RPA collective modes and instability detection [notebook]
- Chebyshev-based mean-field calculations for large systems [notebook]
- Mean-field solvers with automatic differentiation [notebook]
- Spinon mean-field theory of quantum spin models [notebook]
- Mean-field theory of Kondo lattices and heavy fermions [notebook]
- Superfluid weight of superconductors and its quantum geometry [notebook]
- Non-unitarity of spin-triplet superconductors [notebook]
- Excitons from the Bethe-Salpeter equation [notebook]
- Exciton bands as spectral functions [notebook]
- Magnons from time-dependent Hartree-Fock [notebook]
- Magnons from a pair-basis ladder [notebook]
- Matrix-free and tensor-network Bethe-Salpeter solvers [notebook]
- Static RPA screened interaction [notebook]
- GPU execution of the heavy kernels [notebook]
Topological characterization
- Berry phases, Berry curvatures, Chern numbers and Z2 invariants [notebook]
- Operator-resolved Chern numbers and Berry density [notebook]
- Frequency resolved topological density [notebook]
- Spatially resolved topological flux [notebook]
- Real-space Chern density for amorphous systems [notebook]
- Non-Abelian quantum geometric tensor and quantum metric [notebook]
- Wilson loop and Green's function formalism [notebook]
- Spin Chern and mirror Chern numbers [notebook]
- Quadrupole moment of higher-order topological insulators [notebook]
- Strong and weak Z2 indices in three dimensions [notebook]
- Winding numbers and Z2 invariants in one dimension [notebook]
- Entanglement entropy and entanglement spectrum [notebook]
- Bott and spin Bott indices of disordered systems [notebook]
- Invariants from symmetry eigenvalues [notebook]
- Chern numbers of magnon and exciton bands [notebook]
- Anomalous Hall conductivity of metals [notebook]
Response functions
- Optical conductivity from the Kubo-Greenwood formula [notebook]
- Drude weight and the optical f-sum rule [notebook]
- Charge-charge response function and its RPA form [notebook]
- Response functions between arbitrary operators [notebook]
- RKKY interaction between magnetic impurities [notebook]
- Second-harmonic generation in crystals without inversion [notebook]
- Excitonic optical absorption and second-harmonic generation [notebook]
- Nonlinear transport, photocurrents and higher harmonics
Spectral functions
- Spectral functions in infinite geometries [notebook]
- Surface spectral functions for semi-infinite systems [notebook]
- Interfacial spectral function in semi-infinite junctions [notebook]
- Single impurities in infinite systems [notebook]
- Quasiparticle interference maps [notebook]
- Green's function renormalization algorithm [notebook]
- Operator and momentum resolved spectral functions [notebook]
Chebyshev kernel polynomial based-algorithms
- Local and full spectral functions [notebook]
- Non-local correlators and Green's functions [notebook]
- Locally resolved expectation values [notebook]
- Operator resolved spectral functions [notebook]
- Reaching system sizes up to 10000000 atoms on a single-core laptop [notebook]
- Kubo conductivity of large disordered systems [notebook]
- Orbital magnetization of large flakes [notebook]
Wannierization
- Maximally-localized Wannier functions for a selected range of bands [notebook]
- Exact reproduction of the selected bands on the Wannier mesh [notebook]
- Band disentanglement with outer and frozen energy windows [notebook]
- Point-group symmetry-enforced Wannierization [notebook]
- Works for 0d, 1d, 2d and 3d periodic Hamiltonians, including Nambu/BdG [notebook]
Quantum transport
- Metal-metal transport [notebook]
- Metal-superconductor transport [notebook]
- Transport through a finite central region between two leads [notebook]
- Fully non-collinear Nambu basis [notebook]
- Non-equilibrium Green's function formalism [notebook]
- Operator-resolved transport [notebook]
- Differential decay rate [notebook]
- Tunneling and contact scanning probe spectroscopy [notebook]
- Multiple Andreev reflection and the AC Josephson effect [notebook]
Classical spin models and lattice-gas Monte Carlo
- Classical Heisenberg spin models with arbitrary exchange couplings [notebook]
- Local energy minimization and magnetization textures [notebook]
- Lattice-gas Monte Carlo with configurable interactions [notebook]
- Ising model Monte Carlo [notebook]
- Correlators, structure factors and thermodynamics from sampling [notebook]
EXAMPLES
Some short examples are below, each with the figure it gives. Many more are
in examples/.
Band structure of a Kagome lattice
from pyqula import geometry
g = geometry.kagome_lattice() # get the geometry object
h = g.get_hamiltonian() # get the Hamiltonian object
(k,e) = h.get_bands() # compute the band structure
Valley-resolved band structure of a honeycomb superlattice
from pyqula import geometry
g = geometry.honeycomb_lattice() # get the geometry object
g = g.get_supercell(7) # create a supercell
h = g.get_hamiltonian() # get the Hamiltonian object
(k,e,v) = h.get_bands(operator="valley") # compute the band structure
Interaction-driven spin-singlet superconductivity
from pyqula import geometry
import numpy as np
g = geometry.triangular_lattice() # geometry of a triangular lattice
h = g.get_hamiltonian() # get the Hamiltonian
h.setup_nambu_spinor() # setup the Nambu form of the Hamiltonian
# perform SCF, on a k-mesh that resolves the superconducting gap
h = h.get_mean_field_hamiltonian(U=-2.0,filling=0.45,mf="swave",nk=40)
# electron spectral-function
h.get_kdos_bands(operator="electron",nk=400,energies=np.linspace(-2.0,2.0,200),delta=0.03)
Interaction driven non-unitary spin-triplet superconductor
import numpy as np
from pyqula import geometry
g = geometry.triangular_lattice() # generate the geometry
h = g.get_hamiltonian() # create Hamiltonian of the system
h.add_exchange([0.,0.,1.]) # add exchange field
h.setup_nambu_spinor() # initialize the Nambu basis
# perform a superconducting non-collinear mean-field calculation,
# on a k-mesh that resolves the superconducting gap
h = h.get_mean_field_hamiltonian(V1=-1.5,filling=0.3,mf="random",nk=40)
# compute the non-unitarity of the spin-triplet superconducting d-vector
d = h.get_dvector_non_unitarity(nk=40) # non-unitarity of spin-triplet
# electron spectral-function
h.get_kdos_bands(operator="electron",nk=400,energies=np.linspace(-2.0,2.0,200),delta=0.03)
Mean-field with local interactions of a zigzag honeycomb ribbon
from pyqula import geometry
g = geometry.honeycomb_zigzag_ribbon(10) # create geometry of a zigzag ribbon
h = g.get_hamiltonian() # create hamiltonian of the system
h = h.get_mean_field_hamiltonian(U=1.0,filling=0.5,mf="ferro")
(k,e,sz) = h.get_bands(operator="sz") # calculate band structure
Non-collinear mean-field with local interactions of a square lattice
from pyqula import geometry
g = geometry.square_lattice() # geometry of a square lattice
g = g.get_supercell([2,2]) # generate a 2x2 supercell
h = g.get_hamiltonian() # create hamiltonian of the system
h.add_zeeman([0.,0.,0.1]) # add out-of-plane Zeeman field
h = h.get_mean_field_hamiltonian(U=2.0,filling=0.5,mf="random") # perform SCF
(k,e,c) = h.get_bands(operator="sz") # calculate band structure
m = h.get_magnetization() # get the magnetization
Interaction-induced non-collinear magnetism in a defective square lattice with spin-orbit coupling
from pyqula import geometry
g = geometry.square_lattice() # geometry of a square lattice
g = g.get_supercell([7,7]) # generate a 7x7 supercell
g = g.remove(i=g.get_central()[0]) # remove the central site
h = g.get_hamiltonian() # create hamiltonian of the system
h.add_rashba(.4) # add Rashba spin-orbit coupling
h = h.get_mean_field_hamiltonian(U=2.0,filling=0.5,mf="random") # perform SCF
(k,e,c) = h.get_bands(operator="sz") # calculate band structure
m = h.get_magnetization() # get the magnetization
RPA many-body response function in an antiferromagnet
from pyqula import geometry
import numpy as np
g = geometry.bisquare_ribbon(2) # square bipartite ribbon
h = g.get_hamiltonian() # generate Hamiltonian
h = h.get_mean_field_hamiltonian(U=3.,nk=10,mf="antiferro",filling=0.5) # SCF
energies=np.linspace(.0,1.6,400) # energies
# RPA many-body spin spectral function
(qs,es,chis) = h.get_qdos_iets(energies = energies,nq=100,nk=10,
delta=1e-2,qpath=["G","X"])
RPA many-body response function in a ferromagnet
from pyqula import geometry ; import numpy as np
g = geometry.lieb_ribbon(2) # Lieb lattice ribbon
h = g.get_hamiltonian() # generate Hamiltonian
h = h.get_mean_field_hamiltonian(U=3.,mf="antiferro",filling=0.5) # perform SCF
energies=np.linspace(.0,1.,400) # energies
# RPA many-body spin spectral function
(qs,es,chis) = h.get_qdos_iets(energies = energies,nq=100,nk=10,
delta=1e-2,qpath=["G","X"])
Band structure of twisted bilayer graphene
from pyqula import specialhamiltonian # special Hamiltonians library
h = specialhamiltonian.twisted_bilayer_graphene() # TBG Hamiltonian
(k,e) = h.get_bands() # compute band structure
Band structure of monolayer NbSe2
from pyqula import specialhamiltonian # special Hamiltonians library
h = specialhamiltonian.NbSe2(soc=0.5) # NbSe2 Hamiltonian
(k,e,c) = h.get_bands(operator="sz",kpath=["G","K","M","G"]) # compute bands
Chern number of an artificial Chern insulator
from pyqula import geometry
g = geometry.honeycomb_lattice()
h = g.get_hamiltonian()
h.add_rashba(0.2) # Rashba spin-orbit coupling
h.add_zeeman([0.,0.,0.6]) # Zeeman field
from pyqula import topology
(kx,ky,omega) = h.get_berry_curvature() # compute Berry curvature
c = h.get_chern() # compute the Chern number
Topological phase transition in an artificial topological superconductor
import numpy as np
from pyqula import geometry
g = geometry.chain() # create a chain
g = g.supercell(100) # create a large supercell
g.dimensionality = 0 # make it finite
for J in np.linspace(0.,0.2,50): # loop over exchange couplings
h = g.get_hamiltonian() # create a new hamiltonian
h.add_onsite(2.0) # shift the chemical potential
h.add_rashba(.3) # add rashba spin-orbit coupling
h.add_exchange([0.,0.,J]) # add exchange coupling
h.add_swave(.1) # add s-wave superconductivity
edge = h.get_operator("location",r=g.r[0]) # projector on the edge
energies = np.linspace(-.2,.2,200) # set of energies
(e0,d0) = h.get_dos(operator=edge,energies=energies,delta=2e-3) # edge DOS
Spatial distribution of Majorana modes in an artificial topological superconductor
import numpy as np
from pyqula import geometry
g = geometry.chain() # create a chain
g = g.supercell(100) # create a large supercell
g.dimensionality = 0 # make it finite
h = g.get_hamiltonian() # create a new hamiltonian
h.add_onsite(2.0) # shift the chemical potential
h.add_rashba(.3) # add rashba spin-orbit coupling
h.add_exchange([0.,0.,0.15]) # add exchange coupling
h.add_swave(.1) # add s-wave superconductivity
energies = np.linspace(-.15,.15,200) # set of energies
for ri in g.r: # loop over sites
edge = h.get_operator("location",r=ri) # projector on that site
(e0,d0) = h.get_dos(operator=edge,energies=energies,delta=2e-3) # local DOS
Unfolded electronic structure of a supercell with a defect
from pyqula import geometry
import numpy as np
g = geometry.honeycomb_lattice() # create a honeycomb lattice
n = 3 # size of the supercell
g = g.get_supercell(n,store_primal=True) # create a supercell
h = g.get_hamiltonian() # get the Hamiltonian
fons = lambda r: (np.sum((r - g.r[0])**2)<1e-2)*100 # onsite in the impurity
h.add_onsite(fons) # add onsite energy
kpath = np.array(g.get_kpath(nk=200))*n # enlarged k-path
h.get_kdos_bands(operator="unfold",delta=1e-1,kpath=kpath) # unfolded bands
Moire band structure of a moire superlattice
from pyqula import geometry
from pyqula import potentials
g = geometry.triangular_lattice() # create geometry
g = g.get_supercell([7,7]) # create a supercell
h = g.get_hamiltonian() # get the Hamiltonian
fmoire = potentials.commensurate_potential(g,n=3,minmax=[0,1]) # moire potential
h.add_onsite(fmoire) # add onsite energy following the moire
h.get_bands(operator=fmoire) # project on the moire
Unfolded electronic structure of a moire superstructure
from pyqula import geometry
from pyqula import potentials
import numpy as np
g0 = geometry.triangular_lattice() # create geometry
n = 5 # supercell
g = g0.get_supercell(n,store_primal=True) # create a supercell
h = g.get_hamiltonian() # get the Hamiltonian
fmoire = potentials.commensurate_potential(g,n=3,minmax=[0,1]) # moire potential
h.add_onsite(fmoire) # add onsite energy following the moire
kpath = np.array(g.get_kpath(nk=400))*n # enlarged k-path
h.get_kdos_bands(operator="unfold",delta=2e-2,kpath=kpath,
energies=np.linspace(-3,-1,300)) # unfolded bands
Band structure of a nodal line semimetal slab
from pyqula import geometry
from pyqula import films
g = geometry.diamond_lattice()
g = films.geometry_film(g,nz=20)
h = g.get_hamiltonian()
(k,e) = h.get_bands()
Band structure of a three dimensional topological insulator slab
from pyqula import geometry
from pyqula import films
import numpy as np
g = geometry.diamond_lattice() # create a diamond lattice
g = films.geometry_film(g,nz=60) # create a thin film
h = g.get_hamiltonian() # generate Hamiltonian
h.add_strain(lambda r: 1.+abs(r[2])*0.8,mode="directional") # add axial strain
h.add_kane_mele(0.1) # add intrinsic spin-orbit coupling
(k,e,c)= h.get_bands(operator="surface") # compute band structure
Surface spectral function of a 2D quantum spin-Hall insulator
from pyqula import geometry
g = geometry.honeycomb_lattice() # create a honeycomb lattice
h = g.get_hamiltonian() # generate Hamiltonian
h.add_soc(0.15) # add intrinsic spin-orbit coupling
h.add_rashba(0.1) # add Rashba spin-orbit coupling
(es,ks,ds,db) = h.get_surface_kdos(delta=1e-2) # compute surface spectral function
Local density of states with atomic orbitals of a honeycomb nanoisland
from pyqula import islands
g = islands.get_geometry(name="honeycomb",n=3,nedges=3) # get an island
h = g.get_hamiltonian() # get the Hamiltonian
h.get_multildos(projection="atomic") # get the LDOS
Interaction-driven magnetism in a honeycomb nanoisland
from pyqula import islands
g = islands.get_geometry(name="honeycomb",n=3,nedges=3) # get an island
h = g.get_hamiltonian() # get the Hamiltonian
h = h.get_mean_field_hamiltonian(U=1.0,filling=0.5,mf="ferro") # perform SCF
m = h.get_magnetization() # get the magnetization in each site
Hofstadter's butterfly of a square lattice
import numpy as np
from pyqula import geometry
g = geometry.square_ribbon(40) # create square ribbon geometry
for B in np.linspace(0.,1.0,300): # loop over magnetic field
h = g.get_hamiltonian() # create a new hamiltonian
h.add_orbital_magnetic_field(B) # add an orbital magnetic field
# calculate DOS projected on the bulk
(e,d) = h.get_dos(operator="bulk",energies=np.linspace(-4.5,4.5,200))
Landau levels of a Dirac semimetal
import numpy as np
from pyqula import geometry
g = geometry.honeycomb_ribbon(30) # create a honeycomb ribbon
for B in np.linspace(0.,0.02,100): # loop over magnetic field
h = g.get_hamiltonian() # create a new hamiltonian
h.add_orbital_magnetic_field(B) # add an orbital magnetic field
# calculate DOS projected on the bulk
(e,d) = h.get_dos(operator="bulk",energies=np.linspace(-1.0,1.0,200),
delta=1e-2)
Surface spectral function of a Chern insulator
from pyqula import geometry
from pyqula import kdos
g = geometry.honeycomb_lattice() # create honeycomb lattice
h = g.get_hamiltonian() # create hamiltonian of the system
h.add_haldane(0.05) # Add Haldane coupling
kdos.surface(h) # surface spectral function
Surface states and Berry curvature of a artificial 2D topological superconductor
from pyqula import geometry
import numpy as np
g = geometry.triangular_lattice() # get the geometry
h = g.get_hamiltonian() # get the Hamiltonian
h.add_onsite(2.0) # shift chemical potential
h.add_rashba(1.0) # Rashba spin-orbit coupling
h.add_zeeman([0.,0.,0.6]) # Zeeman field
h.add_swave(.3) # add superconductivity
(kx,ky,omega) = h.get_berry_curvature() # compute Berry curvature
(es,ks,ds,db) = h.get_surface_kdos(energies=np.linspace(-.4,.4,300)) # surface spectral function
Surface states in a topological superconductor nanoisland
from pyqula import islands
g = islands.get_geometry(name="triangular",shape="flower",
r=14.2,dr=2.0,nedges=6) # get a flower-shaped island
h = g.get_hamiltonian() # get the Hamiltonian
h.add_onsite(3.0) # shift chemical potential
h.add_rashba(1.0) # Rashba spin-orbit coupling
h.add_zeeman([0.,0.,0.6]) # Zeeman field
h.add_swave(.3) # add superconductivity
h.get_ldos() # Spatially resolved DOS
Antiferromagnet-superconductor interface
from pyqula import geometry
g = geometry.honeycomb_zigzag_ribbon(20) # create geometry of a zigzag ribbon
h = g.get_hamiltonian(has_spin=True) # create hamiltonian of the system
h.add_antiferromagnetism(lambda r: (r[1]>0)*0.5) # add antiferromagnetism
h.add_onsite(lambda r: (r[1]>0)*0.3) # add chemical potential
h.add_swave(lambda r: (r[1]<0)*0.3) # add superconductivity
(k,e,sz) = h.get_bands(operator="sz") # calculate band structure
Fermi surface of a triangular lattice supercell
from pyqula import geometry
import numpy as np
g = geometry.triangular_lattice() # create geometry of the system
g = g.get_supercell(2) # create a supercell
h = g.get_hamiltonian() # create hamiltonian of the system
h.get_multi_fermi_surface(energies=np.linspace(-4,4,100),delta=1e-1)
Unfolded Fermi surface of a supercell with a defect
from pyqula import geometry
import numpy as np
g0 = geometry.triangular_lattice()
n = 3 # size of the supercell
g = g0.get_supercell(n,store_primal=True) # create a supercell
h = g.get_hamiltonian() # get the Hamiltonian
fons = lambda r: (np.sum((r - g.r[0])**2)<1e-2)*100 # onsite in the impurity
h.add_onsite(fons) # add onsite energy
kpath = np.array(g.get_kpath(nk=200))*n # enlarged k-path
h.get_multi_fermi_surface(nk=50,energies=np.linspace(-4,4,100),
delta=0.1,nsuper=n,operator="unfold")
Tunneling and Andreev reflection in a metal-superconductor junction
from pyqula import geometry
from pyqula import heterostructures
import numpy as np
g = geometry.chain() # create the geometry
h = g.get_hamiltonian() # create the Hamiltonian
h1 = h.copy() # first lead
h2 = h.copy() # second lead
h2.add_swave(.01) # the second lead is superconducting
es = np.linspace(-.03,.03,100) # set of energies for dIdV
for T in np.linspace(1e-3,1.0,6): # loop over transparencies
HT = heterostructures.build(h1,h2) # create the junction
HT.set_coupling(T) # set the coupling between the leads
Gs = [HT.didv(energy=e) for e in es] # calculate conductance
From tunneling to contact transport of a topological superconductor
from pyqula import geometry
from pyqula import heterostructures
import numpy as np
g = geometry.chain() # create the geometry
h = g.get_hamiltonian() # create teh Hamiltonian
h1 = h.copy() # first lead
h2 = h.copy() # second lead
h2.add_onsite(2.0) # shift chemical potential in the second lead
h2.add_exchange([0.,0.,.3]) # add exchange in the second lead
h2.add_rashba(.3) # add Rashba SOC in the second lead
h2.add_swave(.05) # add s-wave SC in the second lead
es = np.linspace(-.1,.1,100) # grid of energies
for T in np.linspace(1e-3,0.5,10): # loop over transparencies
HT = heterostructures.build(h1,h2) # create the junction
HT.set_coupling(T) # set the coupling between the leads
Gs = [HT.didv(energy=e) for e in es] # calculate transmission
Single impurity in an infinite honeycomb lattice
from pyqula import geometry
import numpy as np
from pyqula import embedding
g = geometry.honeycomb_lattice() # create geometry
h = g.get_hamiltonian() # get the Hamiltonian
hv = h.copy() # copy Hamiltonian to create a defective one
hv.add_onsite(lambda r: (np.sum((r - g.r[0])**2)<1e-2)*100) # add a defect
eb = embedding.Embedding(h,m=hv) # create an embedding object
(x,y,d) = eb.ldos(nsuper=19,energy=0.,delta=1e-2) # compute LDOS
Bound state of a single magnetic impurity in an infinite superconductor
from pyqula import geometry
import numpy as np
from pyqula import embedding
g = geometry.square_lattice() # create geometry
h = g.get_hamiltonian() # get the Hamiltonian
h.add_swave(0.1) # add s-wave superconductivity
h.add_onsite(3.0) # shift chemical potential
hv = h.copy() # copy Hamiltonian to create a defective one
hv.add_exchange(lambda r: [0.,0.,(np.sum((r - g.r[0])**2)<1e-2)*6.]) # add magnetic site
eb = embedding.Embedding(h,m=hv) # create an embedding object
ei = eb.get_energy_ingap_state() # get energy of the impurity state
(x,y,d) = eb.ldos(nsuper=19,energy=ei,delta=1e-3) # compute LDOS
Parity switching of a magnetic impurity in an infinite superconductor
from pyqula import geometry
from pyqula import embedding
import numpy as np
g = geometry.square_lattice() # create geometry
for J in np.linspace(0.,4.0,100): # loop over exchange
h = g.get_hamiltonian() # get the Hamiltonian,spinless
h.add_onsite(3.0) # shift chemical potential
h.add_swave(0.2) # add s-wave superconductivity
hv = h.copy() # copy Hamiltonian to create a defective one
# add magnetic site
hv.add_exchange(lambda r: [0.,0.,(np.sum((r - g.r[0])**2)<1e-2)*J])
eb = embedding.Embedding(h,m=hv) # create an embedding object
energies = np.linspace(-0.4,0.4,100) # energies
d = [eb.dos(nsuper=2,delta=1e-2,energy=ei) for ei in energies] # compute DOS
Metadata
Release files for pyqula 0.0.97
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyqula-0.0.97.tar.gz | 1.4 MB | Without provenance | Details for pyqula-0.0.97.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyqula-0.0.97-py3-none-any.whl | Python 3 | none | any | Details for pyqula-0.0.97-py3-none-any.whl |
Total release size: 3.0 MB
Release files / pyqula-0.0.97.tar.gz
| Download URL | pyqula-0.0.97.tar.gz |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71a503515a992e43303ebf79a4ed25097248aa3cf3d83811b5f3ace21132d54b
|
|
BLAKE2b-256 checksum How to use checksums |
9852948aa0db1e022a185d5660d29e58dd893ce690d52d461e24216c25b2bef1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Release files / pyqula-0.0.97-py3-none-any.whl
| Download URL | pyqula-0.0.97-py3-none-any.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85ce4b121d628d40952f51ce46ef1c48578697df67f14a102e60906bdddadafa
|
|
BLAKE2b-256 checksum How to use checksums |
309d4d7ba16fc002571912c7524336b120c9fded6f84403c64fe135958012bd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Security for pyqula 0.0.97
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.