public It(int gamma, int gamma5, Product product, IndexType matrixType, Indicator<GraphType> filter) { this.gamma = gamma; this.gamma5 = gamma5; this.product = product; this.content = product.getContent(); this.matrixType = matrixType; this.partition = PrimitiveSubgraphPartition.calculatePartition(this.content, matrixType); this.filter = filter; }
/** * Creates partition of graph (or equivalently the product of indexed tensors) specified by {@link ProductContent} * taking into account edges (dummy indices) of specified {@link IndexType}. * * @param productContent {@link ProductContent} representing the graph * @param type type of edges to be taken into account in partition */ public PrimitiveSubgraphPartition(ProductContent productContent, IndexType type) { this.pc = productContent; this.fcs = pc.getStructureOfContractions(); this.size = pc.size(); this.type = type; this.used = new BitArray(size); this.partition = calculatePartition(); }
void printData() { ArrayList<SubgraphContainer> subgraphs = new ArrayList<>(); for (IndexType type : matrixTypes) { PrimitiveSubgraph[] sgs = PrimitiveSubgraphPartition.calculatePartition(getContent(), type); out0: for (PrimitiveSubgraph sg : sgs) {
private static Tensor inverseOrderInProduct(Product product, IndexType type) { ProductContent pc = product.getContent(); PrimitiveSubgraph[] subgraphs = PrimitiveSubgraphPartition.calculatePartition(pc, type); Tensor[] data = pc.getDataCopy(); boolean somethingDone = false;
private Tensor expandDiracStructures(final Tensor t) { FromChildToParentIterator iterator = new FromChildToParentIterator(t); Tensor current; while ((current = iterator.next()) != null) { if (!(current instanceof Product)) continue; //early termination if (!containsGammaOr5Matrices(current)) continue; Product product = (Product) current; //positions of matrices PrimitiveSubgraph[] partition = PrimitiveSubgraphPartition.calculatePartition(product.getContent(), matrixType); //traces (expand brackets) boolean containsTraces = false; traces: for (PrimitiveSubgraph subgraph : partition) { if (subgraph.getGraphType() != GraphType.Cycle) continue traces; //expand each cycle containsTraces = true; } if (containsTraces) iterator.set(multiply(product.getIndexlessSubProduct(), expandAndEliminate.transform(product.getDataSubProduct()))); } return iterator.result(); }
ProductContent productContent = product.getContent(); PrimitiveSubgraph[] subgraphs = PrimitiveSubgraphPartition.calculatePartition(productContent, matrixType);
= PrimitiveSubgraphPartition.calculatePartition(pc, matrixType);