/** * Returns string representation of metric tensor name * * @return string representation of metric tensor name */ public String getMetricName() { return nameManager.getMetricName(); }
public boolean isKroneckerOrMetric() { return name.equals(CC.getNameManager().getKroneckerName()) || name.equals(CC.getNameManager().getMetricName()); }
/** * Returns metric tensor with specified indices. * * @param index1 first index * @param index2 second index * @return metric tensor with specified indices * @throws IllegalArgumentException if indices have different states * @throws IllegalArgumentException if indices have different types * @throws IllegalArgumentException if indices have non metric types */ public SimpleTensor createMetric(int index1, int index2) { byte type; if ((type = IndicesUtils.getType(index1)) != IndicesUtils.getType(index2) || !IndicesUtils.haveEqualStates(index1, index2) || !metricTypesBits.get(type)) throw new IllegalArgumentException("Not metric indices."); SimpleIndices indices = IndicesFactory.createSimple(null, index1, index2); NameDescriptor nd = nameManager.mapNameDescriptor(nameManager.getMetricName(), StructureOfIndices.create(indices)); int name = nd.getId(); return Tensors.simpleTensor(name, indices); }