mirror of
https://github.com/triqs/dft_tools
synced 2024-12-26 14:23:38 +01:00
28140f14fb
Mainly on the python part. I had a quick browse through to check if the scripts were still working.
34 lines
837 B
ReStructuredText
34 lines
837 B
ReStructuredText
.. module:: pytriqs.random
|
|
|
|
.. _operators:
|
|
|
|
The Operator class
|
|
===================
|
|
|
|
The TRIQS solvers need to know several operators in order to solve the impurity
|
|
problem. For example, they must know what the local Hamiltonian is, but also its
|
|
quantum numbers (that can be used to improve the speed), possibly some
|
|
operators to be averaged, aso.
|
|
|
|
In order to deal with these objects, TRIQS provides a class that allows to
|
|
manipulate operators.
|
|
|
|
A simple example
|
|
-----------------
|
|
|
|
.. runblock:: python
|
|
|
|
from pytriqs.operators import *
|
|
H = C('up',1) * Cdag('up',2) + C('up',2) * Cdag('up',1)
|
|
print H
|
|
print H - H.dagger()
|
|
print anti_commutator(C('up'),Cdag('up'))
|
|
print anti_commutator(C('up'),0.5*Cdag('down'))
|
|
|
|
|
|
Complete reference
|
|
------------------------
|
|
|
|
.. autoclass:: pytriqs.operators.Operator
|
|
:members:
|