SimpleQuantum is now available for easy-to-setup calculations of (for now just electronic) properties of solids. It provides ways to define and visualize crystal structures and a simple way to do common tasks, like calculate band structures. For now, it can do calculations based on tight binding and nearly free electron models. Associated with it is the Computational Physics for the Masses blog series that documents, line-by-line, how the algorithms are implemented and explains the physics to people with minimal background.
A few quick snippets showing the basic use:
Band diagram of toy model graphene
using SimpleQuantum
# Define the graphene crystal.
graphene = Crystal(
Lattice(2.468Å, 2.468Å, 120),
UnitCell(:C, [2/3, 1/3], [1/3, 2/3])
)
# Create an empty hopping list based on graphene.
grhops = Hoppings(graphene)
# Iterate through unique nearest neighbor pairs and add them to the hopping list.
for hop ∈ SimpleQuantum.unique_neighbors(graphene)
addhop!(grhops, -1.0Ha, hop.i, hop.j, hop.δ)
end
# Assemble the tight binding problem.
grprob = TightBindingProblem(grhops, [
:K => [1/3,1/3],
:Γ => [0,0],
:M => [1/2,0],
:K => [1/3,1/3]
], 0.005)
# Solve the problem.
sol = solve(grprob)
# Plot the band diagram.
plotSolution(sol)
Which outputs:
Visualization of the diamond structure:
using SimpleQuantum
using GLMakie
diamond = Crystal(
Lattice(2.527Å, 2.527Å, 2.527Å, 60, 60, 60),
UnitCell(:C, [0.0, 0.0, 0.0], [1/4, 1/4, 1/4])
)
fig3d = Figure()
axds = Axis3(fig3d, xlabel="x/a₀", ylabel="y/a₀", zlabel="z/a₀", xgridvisible=false, ygridvisible=false, zgridvisible=false, aspect = :data)
axds_single = Axis3(fig3d, xlabel="x/a₀", ylabel="y/a₀", zlabel="z/a₀", xgridvisible=false, ygridvisible=false, zgridvisible=false, aspect = :data)
plotcrystal!(axds, diamond; ncells=2, showcell=false, showbonds=true)
plotcrystal!(axds_single, diamond; ncells=1, showcell=true, showbonds=true)
fig3d[1,1] = axds
fig3d[1,2] = axds_single
current_figure()
Outputs: