-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Generalized Operators
#816
Comments
So, if I get it right, this is a way to move Now, some comments/questions on your discussion. First of all, what is this?
I would say, here, that
I like more doing something like PDOS_charge = op(es)
PDOS_x = si_op.SpinX(es)
... as an equivalent way to do |
Great! Thanks for your inputs!
It is a programming way of saying
Ok, I that makes sense. :)
I agree, I like the first one, better, having thought some more, however, see further down! ;)
No, because you might want to do something different with I have also looked more closely into what
|
Otherwise we should have specific methods to call the necessary methods, in this way arguments can be added as needed. Using So then it would be something like: import sisl.operator as si_op
op = si_op.SpinX()
es = H.eigenstate()
value = si_op.innerprod(es.bra, op, es.ket)
value = si_op.outerprod(es.ket, op, es.bra)
# since the method is generic, and has order specific bra-ket notation, one should also be able to do
value = si_op.innerprod(es op, es)
value = si_op.outerprod(es, op, es) This is a bit opposite of what I just don't know how we should call the There are a couple of things that is necessary:
|
Personally, I think there shouldn't be an import sisl.operator as si_op
op = si_op.SpinX()
es = H.eigenstate()
value_IN = op.inner(es)
value_OUT = op.outer(es) The use of density = es.bra * es.ket
overlap = es_1.bra * es_2.ket I think this is also simple enough to, instead, require an independent |
ah, and I guess that in the above proposition we could also have: value_IN = op.inner(es_1, es_2) # --> es_1.bra * op(es_2.ket)
value_OUT = op.outer(es_1, es_2) # --> es_1.ket * op(es_2.bra) |
One thing is that we will necessarily have the
here the Perhaps it would be smartest to start with only operators and methods (no
Yes, but I think it rather should be: I think I have a pretty clear idea of how this should look, thanks for the inputs! (feel free to add more if you want to!) |
Describe the feature
Operators are a general way to perform operations based on
inputs.
For instance, currently we do:
The velocity is actually an operator, and we might wish
to perform other operators on the eigenstate.
Would it make more sense to change operators to act on
the objects them-selves? It comes with some abstraction, but
also some more interesting automatic handling, and I think added
benefit down the road (way more complicated operators).
I think we could potentially save some things here.
For instance:
This would also make many of the current methods a bit more generic.
And would allow simpler usage of them.
This also brings up the question on how we should deal with bra and ket objects.
Should we do:
Having these one could do PDOS (unexpanded to energies) with something
like this:
So how do we want this to look like?
What we need to decide is how the operator should deal with these points:
diagonal
seems obvious)matrix
state.conj() * state
How should
bra
,ket
and matrix operations look like? It might seem weird to reuse@
and*
.Should we aim for the code to look and feel like the bra-ket notation, or what should we make it
look like?
The text was updated successfully, but these errors were encountered: