2014-05-21 16:35:33 +02:00
|
|
|
from wrap_generator import *
|
|
|
|
|
|
|
|
# The operator class
|
|
|
|
op = class_(
|
|
|
|
py_type = "Operator",
|
|
|
|
c_type = "many_body_operator<double>",
|
2014-06-03 15:09:07 +02:00
|
|
|
c_type_absolute = "triqs::utility::many_body_operator<double>",
|
2014-05-21 16:35:33 +02:00
|
|
|
is_printable= True,
|
2014-05-31 11:38:40 +02:00
|
|
|
arithmetic = ("algebra","with_unit","with_unary_minus","double")
|
2014-05-21 16:35:33 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
op.add_constructor(signature="()", doc="create zero operator")
|
|
|
|
|
|
|
|
# The many_body_operators module
|
2014-05-31 11:38:40 +02:00
|
|
|
module = module_(full_name = "operators2", doc = "Doc to be written")
|
2014-05-21 16:35:33 +02:00
|
|
|
module.add_include("<triqs/operators/many_body_operator.hpp>")
|
|
|
|
module.add_include("<triqs/arrays.hpp>")
|
|
|
|
module.add_using("namespace triqs::utility")
|
|
|
|
module.add_class(op)
|
|
|
|
|
2014-05-31 11:38:40 +02:00
|
|
|
# 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 sign in [
|
|
|
|
"",
|
|
|
|
"std::string ind1",
|
|
|
|
"std::string ind1, std::string ind2",
|
|
|
|
"int i, std::string ind1",
|
|
|
|
"int i, int j"
|
|
|
|
]:
|
|
|
|
module.add_function(name = name, signature="many_body_operator<double>(%s)"%sign, doc=doc)
|
2014-05-21 16:35:33 +02:00
|
|
|
|
2014-05-31 18:51:50 +02:00
|
|
|
module.generate_code()
|
2014-05-21 16:35:33 +02:00
|
|
|
|