From eeba76317101cccf731b77a2513086adc124ab9d Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Thu, 3 Jul 2014 19:22:19 +0200 Subject: [PATCH] Fix #101 operator: add python wrapper for is_zero - added is_zero in python - reorder a bit (module defined first), but that is cosmetics --- pytriqs/operators/operators2_desc.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pytriqs/operators/operators2_desc.py b/pytriqs/operators/operators2_desc.py index 09096a6a..ba49f589 100644 --- a/pytriqs/operators/operators2_desc.py +++ b/pytriqs/operators/operators2_desc.py @@ -1,5 +1,12 @@ from wrap_generator import * +# The many_body_operators module +module = module_(full_name = "pytriqs.operators.operators2", doc = "Doc to be written") +module.add_include("") +module.add_include("") +module.add_using("namespace triqs::utility") + + # The operator class op = class_( py_type = "Operator", @@ -10,12 +17,8 @@ op = class_( ) op.add_constructor(signature="()", doc="create zero operator") +op.add_method("bool is_zero()", doc = "Boolean : is the operator null ?") -# The many_body_operators module -module = module_(full_name = "pytriqs.operators.operators2", doc = "Doc to be written") -module.add_include("") -module.add_include("") -module.add_using("namespace triqs::utility") module.add_class(op) # Add various overload of c, c_dag to the module Annihilation & Creation operators