|
| | Bond (const cytnx_uint64 &dim, const bondType &bd_type=bondType::BD_REG, const std::vector< std::vector< cytnx_int64 > > &in_qnums={}, const std::vector< Symmetry > &in_syms={}) |
| |
| void | Init (const cytnx_uint64 &dim, const bondType &bd_type=bondType::BD_REG, const std::vector< std::vector< cytnx_int64 > > &in_qnums={}, const std::vector< Symmetry > &in_syms={}) |
| | init a bond object
|
| |
| bondType | type () const |
| | return the current tag type
|
| |
| const std::vector< std::vector< cytnx_int64 > > & | qnums () const |
| | return the current quantum number set(s) by reference
|
| |
| std::vector< std::vector< cytnx_int64 > > & | qnums () |
| |
| std::vector< std::vector< cytnx_int64 > > | qnums_clone () const |
| | return copy of the current quantum number set(s)
|
| |
| cytnx_uint64 | dim () const |
| | return the dimension of the bond
|
| |
| cytnx_uint32 | Nsym () const |
| | return the number of symmetries
|
| |
| const std::vector< Symmetry > & | syms () const |
| | return the vector of symmetry objects by reference.
|
| |
| std::vector< Symmetry > & | syms () |
| |
| std::vector< Symmetry > | syms_clone () const |
| | return copy of the vector of symmetry objects.
|
| |
| Bond & | set_type (const bondType &new_bondType) |
| | change the tag-type of the instance Bond
|
| |
| void | clear_type () |
| | change the tag-type to the default value BD_REG
|
| |
| Bond | clone () const |
| | return a copy of the instance Bond
|
| |
| void | combineBond_ (const Bond &bd_in) |
| | combine the input bond with self, inplacely
|
| |
| Bond | combineBond (const Bond &bd_in) const |
| | combine the input bond with self, and return a new combined Bond instance.
|
| |
| Bond | combineBonds (const std::vector< Bond > &bds) |
| | combine multiple input bonds with self, and return a new combined Bond instance.
|
| |
| void | combineBonds_ (const std::vector< Bond > &bds) |
| | combine multiple input bonds with self, inplacely
|
| |
| std::vector< std::vector< cytnx_int64 > > | getUniqueQnums (std::vector< cytnx_uint64 > &counts) |
| | return a sorted qnum sets by removing all the duplicate qnum sets.
|
| |
| std::vector< std::vector< cytnx_int64 > > | getUniqueQnums () |
| |
| cytnx_uint64 | getDegeneracy (const std::vector< cytnx_int64 > &qnum) const |
| | return the degeneracy of specify qnum set.
|
| |
| cytnx_uint64 | getDegeneracy (const std::vector< cytnx_int64 > &qnum, std::vector< cytnx_uint64 > &indices) const |
| |
| std::vector< std::vector< cytnx_int64 > > | calc_reverse_qnums () |
| |
| void | Save (const std::string &fname) const |
| |
| void | Save (const char *fname) const |
| |
| bool | operator== (const Bond &rhs) const |
| |
| bool | operator!= (const Bond &rhs) const |
| |
| Bond | operator* (const Bond &rhs) const |
| |
| Bond & | operator*= (const Bond &rhs) |
| |
the object contains auxiliary properties for each Tensor rank (bond)
| Bond cytnx::Bond::combineBond |
( |
const Bond & |
bd_in | ) |
const |
|
inline |
combine the input bond with self, and return a new combined Bond instance.
- Parameters
-
| bd_in | the bond that to be combined. |
- Returns
- [Bond] a new combined bond instance.
Example:
c++ API:
#include <iostream>
using namespace std;
int main(){
cout << bd_c << endl;
cout << bd_a << endl;
cout << bd_b << endl;
Bond bd_e =
Bond(4,
BD_BRA,{{0,0},{2,1},{-1,1},{3,0}},
cout << bd_f << endl;
cout << bd_d << endl;
cout << bd_e << endl;
return 0;
}
Bond combineBond(const Bond &bd_in) const
combine the input bond with self, and return a new combined Bond instance.
Definition Bond.hpp:268
static Symmetry Zn(const int &n)
create a Zn descrete symmetry object with
Definition Symmetry.hpp:198
static Symmetry U1()
create a U1 symmetry object
Definition Symmetry.hpp:167
@ BD_BRA
Definition Bond.hpp:15
@ BD_KET
Definition Bond.hpp:14
output>
Dim = 150 |type: KET>
Dim = 10 |type: KET>
Dim = 15 |type: KET>
Dim = 12 |type: <BRA
U1:: +0 +2 -1 +3 +2 +4 +1 +5 -4 -2 -5 -1
Z2:: +1 +0 +0 +1 +0 +1 +1 +0 +1 +0 +0 +1
Dim = 3 |type: <BRA
U1:: +0 +2 -4
Z2:: +1 +0 +1
Dim = 4 |type: <BRA
U1:: +0 +2 -1 +3
Z2:: +0 +1 +1 +0
python API:
from cytnx import *
bd_a = Bond(10,BD_KET)
bd_b = Bond(15,BD_KET)
bd_c = bd_a.combineBond(bd_b)
print(bd_a)
print(bd_b)
print(bd_c)
bd_d = Bond(3,BD_BRA,[[0,1],[2,0],[-4,1]],
[Symmetry.U1(),
Symmetry.Zn(2)])
bd_e = Bond(4,BD_BRA,[[0,0],[2,1],[-1,1],[3,0]],
[Symmetry.U1(),
Symmetry.Zn(2)])
bd_f = bd_d.combineBond(bd_e)
print(bd_f)
print(bd_d)
print(bd_e)
output>
Dim = 10 |type: KET>
Dim = 15 |type: KET>
Dim = 150 |type: KET>
Dim = 12 |type: <BRA
U1:: +0 +2 -1 +3 +2 +4 +1 +5 -4 -2 -5 -1
Z2:: +1 +0 +0 +1 +0 +1 +1 +0 +1 +0 +0 +1
Dim = 3 |type: <BRA
U1:: +0 +2 -4
Z2:: +1 +0 +1
Dim = 4 |type: <BRA
U1:: +0 +2 -1 +3
Z2:: +0 +1 +1 +0
| void cytnx::Bond::combineBond_ |
( |
const Bond & |
bd_in | ) |
|
|
inline |
combine the input bond with self, inplacely
- Parameters
-
| bd_in | the bond that to be combined with self. |
Example:
c++ API:
#include <iostream>
using namespace std;
int main(){
cout << bd_a << endl;
cout << bd_b << endl;
cout << bd_a << endl;
cout << bd_c << endl;
Bond bd_d =
Bond(4,
BD_BRA,{{0,0},{2,1},{-1,1},{3,0}},
cout << bd_d << endl;
cout << bd_c << endl;
return 0;
}
void combineBond_(const Bond &bd_in)
combine the input bond with self, inplacely
Definition Bond.hpp:249
output>
Dim = 10 |type: REGULAR
Dim = 5 |type: REGULAR
Dim = 50 |type: REGULAR
Dim = 3 |type: <BRA
U1:: +0 +2 -4
Z2:: +1 +0 +1
Dim = 4 |type: <BRA
U1:: +0 +2 -1 +3
Z2:: +0 +1 +1 +0
Dim = 12 |type: <BRA
U1:: +0 +2 -1 +3 +2 +4 +1 +5 -4 -2 -5 -1
Z2:: +1 +0 +0 +1 +0 +1 +1 +0 +1 +0 +0 +1
python API:
from cytnx import *
bd_a = Bond(10)
print(bd_a)
bd_b = Bond(5)
print(bd_b)
bd_a.combineBond_(bd_b)
print(bd_a)
bd_c = Bond(3,BD_BRA,[[0,1],[2,0],[-4,1]],
[Symmetry.U1(),
Symmetry.Zn(2)])
print(bd_c)
bd_d = Bond(4,BD_BRA,[[0,0],[2,1],[-1,1],[3,0]],
[Symmetry.U1(),
Symmetry.Zn(2)])
print(bd_d)
bd_c.combineBond_(bd_d)
print(bd_c)
output>
Dim = 10 |type: REGULAR
Dim = 5 |type: REGULAR
Dim = 50 |type: REGULAR
Dim = 3 |type: <BRA
U1:: +0 +2 -4
Z2:: +1 +0 +1
Dim = 4 |type: <BRA
U1:: +0 +2 -1 +3
Z2:: +0 +1 +1 +0
Dim = 12 |type: <BRA
U1:: +0 +2 -1 +3 +2 +4 +1 +5 -4 -2 -5 -1
Z2:: +1 +0 +0 +1 +0 +1 +1 +0 +1 +0 +0 +1
| Bond cytnx::Bond::combineBonds |
( |
const std::vector< Bond > & |
bds | ) |
|
|
inline |
combine multiple input bonds with self, and return a new combined Bond instance.
- Parameters
-
| bds | the bonds that to be combined with self. |
- Returns
- [Bond] a new combined bond instance.
Example:
c++ API:
#include <iostream>
using namespace std;
int main(){
cout << bd_a << endl;
cout << bd_b << endl;
cout << bd_c << endl;
cout << bd_d << endl;
cout << bd_all << endl;
{2,0},
{-4,1}},
{2 ,1},
{-1,1},
{3 ,0}},
{1 ,1},
{-1,1},
{-2,0},
{0 ,0}},
cout << bd_sym_a << endl;
cout << bd_sym_b << endl;
cout << bd_sym_c << endl;
cout << bd_sym_d << endl;
return 0;
}
Bond combineBonds(const std::vector< Bond > &bds)
combine multiple input bonds with self, and return a new combined Bond instance.
Definition Bond.hpp:289
output>
Dim = 10 |type: KET>
Dim = 4 |type: KET>
Dim = 5 |type: KET>
Dim = 2 |type: KET>
Dim = 400 |type: KET>
Dim = 3 |type: <BRA
U1:: +0 +2 -4
Z2:: +1 +0 +1
Dim = 4 |type: <BRA
U1:: +0 +2 -1 +3
Z2:: +0 +1 +1 +0
Dim = 5 |type: <BRA
U1:: +1 +1 -1 -2 +0
Z2:: +1 +1 +1 +0 +0
Dim = 60 |type: <BRA
U1:: +1 +1 -1 -2 +0 +3 +3 +1 +0 +2 +0 +0 -2 -3 -1 +4 +4 +2 +1 +3 +3 +3 +1 +0 +2 +5 +5 +3 +2 +4 +2 +2 +0 -1 +1 +6 +6 +4 +3 +5 -3 -3 -5 -6 -4 -1 -1 -3 -4 -2 -4 -4 -6 -7 -5 +0 +0 -2 -3 -1
Z2:: +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1
python API:
from cytnx import *
bd_a = Bond(10,BD_KET);
bd_b = Bond(4,BD_KET);
bd_c = Bond(5,BD_KET);
bd_d = Bond(2,BD_KET);
bd_all = bd_a.combineBonds([bd_b,bd_c,bd_d]);
print( bd_a )
print( bd_b )
print( bd_c )
print( bd_d )
print( bd_all )
bd_sym_a = Bond(3,BD_BRA,[[0,1],
[2,0],
[-4,1]],
[Symmetry.U1(),
Symmetry.Zn(2)]);
bd_sym_b = Bond(4,BD_BRA,[[0 ,0],
[2 ,1],
[-1,1],
[3 ,0]],
[Symmetry.U1(),
Symmetry.Zn(2)]);
bd_sym_c = Bond(5,BD_BRA,[[1 ,1],
[1 ,1],
[-1,1],
[-2,0],
[0 ,0]],
[Symmetry.U1(),
Symmetry.Zn(2)]);
bd_sym_d = bd_sym_a.combineBonds([bd_sym_b,bd_sym_c]);
print( bd_sym_a )
print( bd_sym_b )
print( bd_sym_c )
print( bd_sym_d )
output>
Dim = 10 |type: KET>
Dim = 4 |type: KET>
Dim = 5 |type: KET>
Dim = 2 |type: KET>
Dim = 400 |type: KET>
Dim = 3 |type: <BRA
U1:: +0 +2 -4
Z2:: +1 +0 +1
Dim = 4 |type: <BRA
U1:: +0 +2 -1 +3
Z2:: +0 +1 +1 +0
Dim = 5 |type: <BRA
U1:: +1 +1 -1 -2 +0
Z2:: +1 +1 +1 +0 +0
Dim = 60 |type: <BRA
U1:: +1 +1 -1 -2 +0 +3 +3 +1 +0 +2 +0 +0 -2 -3 -1 +4 +4 +2 +1 +3 +3 +3 +1 +0 +2 +5 +5 +3 +2 +4 +2 +2 +0 -1 +1 +6 +6 +4 +3 +5 -3 -3 -5 -6 -4 -1 -1 -3 -4 -2 -4 -4 -6 -7 -5 +0 +0 -2 -3 -1
Z2:: +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1
| void cytnx::Bond::combineBonds_ |
( |
const std::vector< Bond > & |
bds | ) |
|
|
inline |
combine multiple input bonds with self, inplacely
- Parameters
-
| bds | the bonds that to be combined with self. |
Example:
c++ API:
#include <iostream>
using namespace std;
int main(){
cout << bd_a << endl;
cout << bd_b << endl;
cout << bd_c << endl;
cout << bd_d << endl;
cout << bd_a << endl;
{2,0},
{-4,1}},
{2 ,1},
{-1,1},
{3 ,0}},
{1 ,1},
{-1,1},
{-2,0},
{0 ,0}},
cout << bd_sym_a << endl;
cout << bd_sym_b << endl;
cout << bd_sym_c << endl;
cout << bd_sym_a << endl;
return 0;
}
void combineBonds_(const std::vector< Bond > &bds)
combine multiple input bonds with self, inplacely
Definition Bond.hpp:311
output>
Dim = 10 |type: KET>
Dim = 4 |type: KET>
Dim = 5 |type: KET>
Dim = 2 |type: KET>
Dim = 400 |type: KET>
Dim = 3 |type: <BRA
U1:: +0 +2 -4
Z2:: +1 +0 +1
Dim = 4 |type: <BRA
U1:: +0 +2 -1 +3
Z2:: +0 +1 +1 +0
Dim = 5 |type: <BRA
U1:: +1 +1 -1 -2 +0
Z2:: +1 +1 +1 +0 +0
Dim = 60 |type: <BRA
U1:: +1 +1 -1 -2 +0 +3 +3 +1 +0 +2 +0 +0 -2 -3 -1 +4 +4 +2 +1 +3 +3 +3 +1 +0 +2 +5 +5 +3 +2 +4 +2 +2 +0 -1 +1 +6 +6 +4 +3 +5 -3 -3 -5 -6 -4 -1 -1 -3 -4 -2 -4 -4 -6 -7 -5 +0 +0 -2 -3 -1
Z2:: +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1
python API:
from cytnx import *
bd_a = Bond(10,BD_KET);
bd_b = Bond(4,BD_KET);
bd_c = Bond(5,BD_KET);
bd_d = Bond(2,BD_KET);
print( bd_a )
print( bd_b )
print( bd_c )
print( bd_d )
bd_a.combineBonds_([bd_b,bd_c,bd_d]);
print( bd_a )
bd_sym_a = Bond(3,BD_BRA,[[0,1],
[2,0],
[-4,1]],
[Symmetry.U1(),
Symmetry.Zn(2)]);
bd_sym_b = Bond(4,BD_BRA,[[0 ,0],
[2 ,1],
[-1,1],
[3 ,0]],
[Symmetry.U1(),
Symmetry.Zn(2)]);
bd_sym_c = Bond(5,BD_BRA,[[1 ,1],
[1 ,1],
[-1,1],
[-2,0],
[0 ,0]],
[Symmetry.U1(),
Symmetry.Zn(2)]);
print( bd_sym_a )
print( bd_sym_b )
print( bd_sym_c )
bd_sym_a.combineBonds_([bd_sym_b,bd_sym_c]);
print( bd_sym_a )
output>
Dim = 10 |type: KET>
Dim = 4 |type: KET>
Dim = 5 |type: KET>
Dim = 2 |type: KET>
Dim = 400 |type: KET>
Dim = 3 |type: <BRA
U1:: +0 +2 -4
Z2:: +1 +0 +1
Dim = 4 |type: <BRA
U1:: +0 +2 -1 +3
Z2:: +0 +1 +1 +0
Dim = 5 |type: <BRA
U1:: +1 +1 -1 -2 +0
Z2:: +1 +1 +1 +0 +0
Dim = 60 |type: <BRA
U1:: +1 +1 -1 -2 +0 +3 +3 +1 +0 +2 +0 +0 -2 -3 -1 +4 +4 +2 +1 +3 +3 +3 +1 +0 +2 +5 +5 +3 +2 +4 +2 +2 +0 -1 +1 +6 +6 +4 +3 +5 -3 -3 -5 -6 -4 -1 -1 -3 -4 -2 -4 -4 -6 -7 -5 +0 +0 -2 -3 -1
Z2:: +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +0 +0 +1 +1 +1 +0 +0 +0 +0 +0 +1 +1