ScaMaC  0.8.2
A Scalable Matrix Collection
All Files Functions Typedefs Modules Pages
scamac_dof_fermions.h
Go to the documentation of this file.
1 
8 #ifndef SCAMAC_DOF_FERMIONS_H
9 #define SCAMAC_DOF_FERMIONS_H
10 
11 #include "scamac_error.h"
12 
13 /* quantum mechanical degree of freedom: fermions */
14 
15 typedef struct {
16  /* number of sites */
17  int n_sites;
18  /* number of fermions */
19  int n_fermions;
20 
21  /* number of states */
22  ScamacIdx ns;
23 
24  /* count information */
25  ScamacIdx *cnt;
26 
27 } scamac_dof_fermions_st;
28 
29 //typedef unsigned char * scamac_rep_fermions_st; // "bit" would suffice
30 typedef int scamac_rep_fermions_st;
31 
32 ScamacErrorCode scamac_dof_fermions_alloc(int n_sites, int n_fermions, scamac_dof_fermions_st ** dof);
33 void scamac_dof_fermions_free(scamac_dof_fermions_st * dof);
34 
35 ScamacIdx scamac_dof_fermions_ns(const scamac_dof_fermions_st * dof);
36 
37 scamac_rep_fermions_st * scamac_rep_fermions_alloc(const scamac_dof_fermions_st *dof);
38 void scamac_rep_fermions_free(scamac_rep_fermions_st * rep);
39 
40 void scamac_rep_fermions_copy(const scamac_dof_fermions_st *dof, const scamac_rep_fermions_st * rep, scamac_rep_fermions_st * repcpy);
41 
42 ScamacErrorCode scamac_fermions_decode(const scamac_dof_fermions_st * dof, ScamacIdx idx, scamac_rep_fermions_st *rep);
43 ScamacIdx scamac_fermions_encode(const scamac_dof_fermions_st * dof, const scamac_rep_fermions_st *rep);
44 
45 /* operators */
46 double scamac_op_fermions_cdc (const scamac_dof_fermions_st * dof, const scamac_rep_fermions_st *rep, int ic);
47 double scamac_op_fermions_nn (const scamac_dof_fermions_st * dof, const scamac_rep_fermions_st *rep, int i, int j);
48 
49 double scamac_op_fermions_cdicj(const scamac_dof_fermions_st * dof, scamac_rep_fermions_st *rep, int i, int j);
50 double scamac_op_fermions_hop (const scamac_dof_fermions_st * dof, scamac_rep_fermions_st *rep, int i, int j);
51 
52 
53 #endif /* SCAMAC_DOF_FERMIONS_H */
ScaMaC data structure and macro definitions.