Skip to content
Permalink
Browse files

Fix examples

  • Loading branch information
mfherbst committed Feb 7, 2020
1 parent 36a1e94 commit ae067fb7945d58c27fe38733cbd7c70e1ce5564b
@@ -15,15 +15,15 @@ lattice = [4.659533614391621 -2.3297668071958104 0.0;
0.0 4.035274479829987 0.0;
0.0 0.0 15.117809010356462]
C = Species(6, load_psp("hgh/pbe/c-q4"))
composition = [C => [[0.0, 0.0, 0.0], [0.33333333333, 0.66666666667, 0.0]]]
atoms = [C => [[0.0, 0.0, 0.0], [0.33333333333, 0.66666666667, 0.0]]]

model = model_dft(lattice, [:gga_x_pbe, :gga_c_pbe], composition...;
model = model_dft(lattice, [:gga_x_pbe, :gga_c_pbe], atoms;
temperature=Tsmear, smearing=DFTK.Smearing.Gaussian())
basis = PlaneWaveBasis(model, Ecut, kgrid=kgrid)

# Run SCF
n_bands = 6
ham = Hamiltonian(basis, guess_density(basis, composition...))
ham = Hamiltonian(basis, guess_density(basis))
scfres = self_consistent_field(ham, n_bands)
ham = scfres.ham

@@ -56,7 +56,7 @@ model = Model(lattice; n_electrons=n_electrons,
xc=nonlinearity,
spin_polarisation=:spinless # "spinless fermions"
)
basis = PlaneWaveBasis(model, Ecut, kgrid=[1, 1, 1])
basis = PlaneWaveBasis(model, Ecut)

# We solve the self-consistent equation with an SCF algorithm (which
# is a pretty bad idea; implementing direct minimization is TODO)
@@ -35,7 +35,7 @@ model = model_dft(lattice, [:gga_x_pbe, :gga_c_pbe], atoms;
basis = PlaneWaveBasis(model, Ecut, kgrid=kgrid)

# Run SCF
ham = Hamiltonian(basis, guess_density(basis, atoms))
ham = Hamiltonian(basis, guess_density(basis))
scfres = self_consistent_field(ham, n_bands)
ham = scfres.ham

@@ -19,7 +19,7 @@ model = model_dft(Array{T}(lattice), [:lda_x, :lda_c_vwn], atoms)
basis = PlaneWaveBasis(model, Ecut, kgrid=kgrid)

# Run SCF, note Silicon metal is an insulator, so no need for all bands here
ham = Hamiltonian(basis, guess_density(basis, atoms))
ham = Hamiltonian(basis, guess_density(basis))
n_bands = 4
scfres = self_consistent_field(ham, n_bands, tol=1e-6)

@@ -128,6 +128,7 @@ function PlaneWaveBasis(model::Model{T}, Ecut::Number,
kweights, ksymops, fft_size, grids, opFFT, ipFFT, opIFFT, ipIFFT
)
end

function PlaneWaveBasis(model::Model, Ecut::Number;
kgrid=[1, 1, 1], enable_bzmesh_symmetry=true, kwargs...)
if enable_bzmesh_symmetry

0 comments on commit ae067fb

Please sign in to comment.
You can’t perform that action at this time.