private static void check(IndexType type, SimpleTensor momentum) { if (momentum.getIndices().size() != 1) throw new IllegalArgumentException("Not a momentum: " + momentum); if (type != null && type != getTypeEnum(momentum.getIndices().get(0))) throw new IllegalArgumentException("Not a momentum: " + momentum + " wrong index type"); }
/** * Returns all non metric types that present in specified indices. * * @param indices indices * @return all non metric types that present in specified indices */ public static EnumSet<IndexType> nonMetricTypes(final Indices indices) { EnumSet<IndexType> types = EnumSet.noneOf(IndexType.class); for (int i = 0; i < indices.size(); ++i) { int index = indices.get(i); if (!CC.isMetric(getType(index))) types.add(getTypeEnum(index)); } return types; } }
private static void check(SimpleTensor loopMomentum, SimpleTensor[] externalMomentums) { check(null, loopMomentum); IndexType type = getTypeEnum(loopMomentum.getIndices().get(0)); for (SimpleTensor externalMomentum : externalMomentums) check(type, externalMomentum); }
static void checkUnitaryInput(final SimpleTensor unitaryMatrix, final SimpleTensor structureConstant, final SimpleTensor symmetricConstant, final Tensor dimension) { if (dimension instanceof Complex && !TensorUtils.isNaturalNumber(dimension)) throw new IllegalArgumentException("Non natural degree."); if (unitaryMatrix.getIndices().size() != 3) throw new IllegalArgumentException("Not a unitary matrix: " + unitaryMatrix); IndexType[] types = TraceUtils.extractTypesFromMatrix(unitaryMatrix); IndexType metricType = types[0]; if (!TensorUtils.isScalar(dimension)) throw new IllegalArgumentException("Non scalar degree."); if (structureConstant.getName() == symmetricConstant.getName()) throw new IllegalArgumentException("Structure and symmetric constants have same names."); SimpleTensor[] ss = {structureConstant, symmetricConstant}; for (SimpleTensor st : ss) { if (st.getIndices().size() != 3) throw new IllegalArgumentException("Illegal input for SU(N) constants: " + st); for (int i = 0; i < 3; ++i) if (IndicesUtils.getTypeEnum(st.getIndices().get(i)) != metricType) throw new IllegalArgumentException("Different indices metric types: " + unitaryMatrix + " and " + st); } }
continue; if (Tensors.isKroneckerOrMetric(st)) { usedTypes.add(getTypeEnum(st.getIndices().get(0))); continue; int[] free = new int[si.size()]; for (int i = si.size() - 1; i >= 0; --i) { usedTypes.add(getTypeEnum(si.get(i))); free[i] = createIndex(i, getType(si.get(i)), getState(si.get(i)));
private SimpleIndices transformIndices(SimpleIndices old, NameAndStructureOfIndices oldDescriptor) { int[] newIndices = new int[old.size()]; for (int i = old.size() - 1; i >= 0; --i) { newIndices[i] = IndicesUtils.setType(transformer.newType(IndicesUtils.getTypeEnum(old.get(i)), oldDescriptor), old.get(i)); newIndices[i] = transformer.newIndex(newIndices[i], oldDescriptor); } return IndicesFactory.createSimple(null, newIndices); } }
this.minkowskiSpace = minkowskiSpace; this.numberOfIndices = leviCivita.getIndices().size(); this.typeOfLeviCivitaIndices = IndicesUtils.getTypeEnum(leviCivita.getIndices().get(0));
public SchoutenIdentities4(SimpleTensor leviCivita) { this.leviCivita = leviCivita; ChangeIndicesTypesAndTensorNames tokenTransformer = new ChangeIndicesTypesAndTensorNames(TypesAndNamesTransformer.Utils.and( TypesAndNamesTransformer.Utils.changeName(new String[]{"e"}, new String[]{leviCivita.getStringName()}), TypesAndNamesTransformer.Utils.changeType(IndexType.LatinLower, IndicesUtils.getTypeEnum(leviCivita.getIndices().get(0))))); this.schouten1 = new Tensor[schoutenCombinations1.length]; for (int i = 0; i < schouten1.length; i++) schouten1[i] = tokenTransformer.transform(CC.current().getParseManager().getParser().parse(schoutenCombinations1[i])).toTensor(); this.schouten2 = new Tensor[schoutenCombinations2.length]; for (int i = 0; i < schouten2.length; i++) schouten2[i] = tokenTransformer.transform(CC.current().getParseManager().getParser().parse(schoutenCombinations2[i])).toTensor(); this.schouten3 = new Tensor[schoutenCombinations3.length]; for (int i = 0; i < schouten3.length; i++) schouten3[i] = tokenTransformer.transform(CC.current().getParseManager().getParser().parse(schoutenCombinations3[i])).toTensor(); allSchouten = new Tensor[][]{schouten1, schouten2, schouten3}; }