-
Notifications
You must be signed in to change notification settings - Fork 9
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
HubbardHamiltonian as child class of sisl.Hamiltonian? #119
Comments
I think an I have this issue, zerothi/sisl#97. |
Thanks, I had forgotten about zerothi/sisl#97. Any particular inheritance in such a |
I would do something like this: class SCF:
# implement however this one does it
scf = SCF(HubbardHamiltonian, *options_for_scf_or_whatever)
scf.iterate() I.e. SCF stuff should not belong to the Hamiltonian, in my opinion. |
Thanks, I think I grasp your idea. In our specific case it could be something like class SCF:
# general class
class MFH(SCF):
# child class with specifics for the mean-field Hubbard model
mfh = MFH(h0, dm0, U=3, *options)
h1, dm1 = mfh.iterate()
h_conv, dm_conv = mfh.converge() where the user supplies an initial hamiltonian |
Yes, I think something like this would be better, convoluting namespaces is a dangerous path, I think. |
Wouldn't it not be advantageous to change
class HubbardHamiltonian(object)
to be a child class ofsisl.Hamiltonian
? Now it seems to me more logical and we could avoid duplicating a lot of stuff.In fact, perhaps we should think of an intermediate
class SCFHamiltonian(sisl.Hamiltonian)
that would generalize things for iterative/SCF problems (it could perhaps belong in sisl?), and thenclass HubbardHamiltonian(SCFHamiltonian)
for the specifics of our MFH implementation?The text was updated successfully, but these errors were encountered: