unsigned int exchange::possible_singlets(exptree& tr, exptree::iterator it) { std::vector idts; collect_identical_tensors(tr, it, idts); if(idts.size()==0) return 1; // no indices, so this is a singlet already LiE::LiE_t lie; // Figure out the algebra from one of the indices. exptree::index_iterator indit=tr.begin_index(idts[0].tensors[0]); const numerical::Integer *iprop=properties::get(indit, true); if(!iprop) throw consistency_error("Need to know about the range of the " + *indit->name + " index."); // iprop->difference.print_recursive_treeform(txtout, iprop->difference.begin()); unsigned int dims=to_long(*iprop->difference.begin()->multiplier); // std::cout << "*** " << dims << std::endl; if(dims%2==0) lie.algebra_type=LiE::LiE_t::alg_D; else lie.algebra_type=LiE::LiE_t::alg_B; lie.algebra_dim=dims/2; lie.start(); // Find the representation for each group of tensors, taking into // account their exchange symmetries. std::vector groupreps; for(unsigned int i=0; i1) { assert(idts[i].tab); // Every tensor with 2+ indices needs a TableauSymmetry. TableauBase::tab_t thetab=idts[i].tab->get_tab(tr, idts[i].tensors[0], 0); std::vector topleth; for(unsigned int rws=0; rwssign()==-1) ++sign; lie.alt_sym_tensor(idts[i].tensors.size(), single_tensor_rep, multi_tensor_rep, sign%2==0); groupreps.push_back(multi_tensor_rep); } } // Now tensor the whole lot together. LiE::LiE_t::reps_t result=groupreps[0], tmpstore; for(unsigned int i=0; i