Hi - I'm creating an application based on the ALPS classical Monte Carlo app that uses a custom lattice where a subset of the spins are to be designated as impurities.
Here's an example lattice I'm using (just a 4 site chain): <LATTICES> <GRAPH name="test lattice" dimension="1" vertices="4" edges="4"> <VERTEX id="1" type="1"><COORDINATE>0</COORDINATE></VERTEX> <VERTEX id="2" type="0"><COORDINATE>1</COORDINATE></VERTEX> <VERTEX id="3" type="0"><COORDINATE>2</COORDINATE></VERTEX> <VERTEX id="4" type="0"><COORDINATE>2</COORDINATE></VERTEX> <EDGE source="1" target="2" id="1" type="0" vector="1"/> <EDGE source="2" target="3" id="2" type="0" vector="1"/> <EDGE source="3" target="4" id="3" type="0" vector="1"/> <EDGE source="4" target="1" id="4" type="0" vector="1"/> </GRAPH> </LATTICES>
Note how site 1 has type 1, which means it's to be treated as an impurity.
The problem I'm having is that when I'm looping over the bonds/edges using the following code, instead of detecting the bond type as 0 as written in the XML, it's detecting bond 1 as being of type 0, bonds 2 and 3 as being of type 1 and bond 4 as being of type 2. When I make all of the spins/vertices of type 0, however, all of the bonds come out as type 0. Here's the code (in a member function of the SpinSim object, which is a graph_helper object within spinsim.h):
parent::bond_iterator bi; bi = (this->bonds()).first; for (; bi!=(this->bonds()).second; ++bi) { // get bond type int edge_type = this->edge_type(*bi); std::cout << " Bond of type " << edge_type; }
How can I get ALPS to use the bond types that are written instead of making up its own? Thanks!