/** * Returns Kronecker tensor with specified upper and lower indices. * * @param index1 first index * @param index2 second index * @return Kronecker tensor with specified upper and lower indices * @throws IllegalArgumentException if indices have same states * @throws IllegalArgumentException if indices have different types */ public SimpleTensor CreateKronecker(uint index1, uint index2) { byte type; if ((type = IndicesUtils.getType(index1)) != IndicesUtils.getType(index2) || IndicesUtils.getRawStateInt((uint)index1) == IndicesUtils.getRawStateInt((uint)index2)) { throw new ArgumentException("This is not kronecker indices!"); } if (!isMetric(type) && IndicesUtils.getState(index2)) { var t = index1; index1 = index2; index2 = t; } ISimpleIndices indices = IndicesFactory.createSimple(null, index1, index2); var nd = nameManager.mapNameDescriptor(nameManager.getKroneckerName(), new StructureOfIndices(indices)); var name = nd.Id; return(Tensor.SimpleTensor(name, indices)); }
public StructureOfIndices(ISimpleIndices indices) { this.indices = indices; }
public static SimpleTensor SimpleTensor(int name, ISimpleIndices indices) { throw new NotImplementedException(); }
public TensorField(int name, ISimpleIndices indices, Tensor[] args, ISimpleIndices[] argIndices) : base(name, indices) { Args = args; ArgIndices = argIndices; }
/** * Returns string name of tensor. The argument can be {@code null}. * * @param indices indices (in case of metric or Kronecker) and null in other cases * @return string name of tensor */ public abstract string GetName(ISimpleIndices indices);
public SimpleTensor(int name, ISimpleIndices indices) { Name = name; SimpleIndices = indices ?? throw new ArgumentNullException(nameof(indices)); }