/** * Returns metric tensor if specified indices have same states and * Kronecker tensor if specified indices have different states. * * @param index1 first index * @param index2 second index * @return metric tensor if specified indices have same states and * Kronecker tensor if specified indices have different states * @throws IllegalArgumentException if indices have different types * @throws IllegalArgumentException if indices have same states and non metric types */ public static SimpleTensor createMetricOrKronecker(int index1, int index2) { return CC.current().createMetricOrKronecker(index1, index2); }
/** * Returns metric tensor if specified indices have same states and * Kronecker tensor if specified indices have different states. * * @param indices indices * @return metric tensor if specified indices have same states and * Kronecker tensor if specified indices have different states * @throws IllegalArgumentException if indices have different types * @throws IllegalArgumentException if indices have same states and non metric types * @throws IllegalArgumentException if indices.size() != 2 */ public static SimpleTensor createMetricOrKronecker(Indices indices) { if (indices.size() != 2) throw new IllegalArgumentException("Inconsistent indices for metric: " + indices); return CC.current().createMetricOrKronecker(indices.get(0), indices.get(1)); }