+ // check if the spin location is appeared only at the end of the
+ // composite location
+ if (lattice1.getSpinLocSet().contains(loc1.getLocIdentifier())) {
+ if (i != (compLoc1.getSize() - 1)) {
+ throw new Error("The spin location " + loc1.getLocIdentifier()
+ + " cannot be appeared in the middle of composite location.");
+ }
+ }
+
+ if (lattice2.getSpinLocSet().contains(loc2.getLocIdentifier())) {
+ if (i != (compLoc2.getSize() - 1)) {
+ throw new Error("The spin location " + loc2.getLocIdentifier()
+ + " cannot be appeared in the middle of composite location.");
+ }
+ }
+