mirror of
https://github.com/triqs/dft_tools
synced 2024-10-31 19:23:45 +01:00
Add number operator in operator class
This commit is contained in:
parent
62c4b54e56
commit
3eb9b16a57
@ -12,19 +12,20 @@ op = class_(
|
|||||||
op.add_constructor(signature="()", doc="create zero operator")
|
op.add_constructor(signature="()", doc="create zero operator")
|
||||||
|
|
||||||
# The many_body_operators module
|
# The many_body_operators module
|
||||||
module = module_(full_name = "operators2", doc = "Doc to be written")
|
module = module_(full_name = "pytriqs.operators.operators2", doc = "Doc to be written")
|
||||||
module.add_include("<triqs/operators/many_body_operator.hpp>")
|
module.add_include("<triqs/operators/many_body_operator.hpp>")
|
||||||
module.add_include("<triqs/arrays.hpp>")
|
module.add_include("<triqs/arrays.hpp>")
|
||||||
module.add_using("namespace triqs::utility")
|
module.add_using("namespace triqs::utility")
|
||||||
module.add_class(op)
|
module.add_class(op)
|
||||||
|
|
||||||
# Add various overload of c, c_dag to the module Annihilation & Creation operators
|
# Add various overload of c, c_dag to the module Annihilation & Creation operators
|
||||||
for name, doc in [ ("c","annihilation operator"), ("c_dag","creation operator")] :
|
for name, doc in [("c","annihilation operator"), ("c_dag","creation operator"), ("n","number operator")] :
|
||||||
for sign in [
|
for sign in [
|
||||||
"",
|
"",
|
||||||
"std::string ind1",
|
"std::string ind1",
|
||||||
"std::string ind1, std::string ind2",
|
"std::string ind1, std::string ind2",
|
||||||
"int i, std::string ind1",
|
"int i, std::string ind1",
|
||||||
|
"std::string ind1, int i",
|
||||||
"int i, int j"
|
"int i, int j"
|
||||||
]:
|
]:
|
||||||
module.add_function(name = name, signature="many_body_operator<double>(%s)"%sign, doc=doc)
|
module.add_function(name = name, signature="many_body_operator<double>(%s)"%sign, doc=doc)
|
||||||
|
Loading…
Reference in New Issue
Block a user