Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hamiltonian_with_total_potential function #267

Merged
merged 2 commits into from
Jun 23, 2020
Merged

Add hamiltonian_with_total_potential function #267

merged 2 commits into from
Jun 23, 2020

Conversation

antoine-levitt
Copy link
Member

No description provided.

@assert Hk.basis.model.spin_polarization in (:none, :spinless)
operators = [op for op in Hk.operators if !(op isa RealSpaceMultiplication)]
push!(operators, RealSpaceMultiplication(Hk.basis, Hk.kpoint, V))
HamiltonianBlock(Hk.basis, Hk.kpoint, operators, operators, Hk.scratch)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This skips doing the optimisation of operators. Are you sure this is a good idea?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also why not make this a constructor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't in this case, but I agree let's go through the constructor

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty specific, I don't know if it should be a constructor

Copy link
Member

@mfherbst mfherbst Jun 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well we still went for a constructor in this case:
https://github.com/JuliaMolSim/DFTK.jl/blob/master/src/PlaneWaveBasis.jl#L371
which is pretty specific as well. I'm not saying constructor is the right way to go, but would not be the first specific constructor.

@mfherbst mfherbst changed the title Misc fixes and adds Add hamiltonian_with_total_potential function Jun 23, 2020
@mfherbst mfherbst merged commit 9276e9e into master Jun 23, 2020
@mfherbst mfherbst deleted the misc2 branch June 23, 2020 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants