Learn to Use ITensor

main / classes / bondgate

BondGate

BondGate objects represent a quantum "gate" acting on a nearest-neighbor bond of a 1D system. Currently, the associated gateTEvol function of ITensor assumes that sites of a BondGate are neighbors along a 1D ordering of the sites of a system, so please only make BondGates which have this property.

For an example of using BondGate in conjunction with the gateTEvol function, please see this code formula page.

Examples

int N = 100;
auto sites = SpinHalf(N);

// Make an ITensor "hterm" which is the term
// of the Heisenberg model acting on spins 
// 2 and 3:
auto hterm = op(sites,"Sz",2)*op(sites,"Sz",3);
hterm += 0.5*op(sites,"S+",2)*op(sites,"S-",3);
hterm += 0.5*op(sites,"S-",2)*op(sites,"S+",3);

// Make a BondGate which acts as the operator
// exp(-i * hterm * tstep/2)
auto real_h23 = BondGate(sites,2,3,BondGate::tReal,tstep/2.,hterm);

// Make a BondGate which acts as the operator
// exp(-hterm * tstep/2)
auto imag_h23 = BondGate(sites,2,3,BondGate::tImag,tstep/2.,hterm);

// Make a BondGate which swaps sites 7 and 8
auto swap78 = BondGate(sites,7,8);

Constructors

Accessor Methods

Operators


Back to Classes
Back to Main