private String toVectorString(List<String> elements, ToStringContext<NAMETYPE> context) {
        if (elements.size() == 1)
            return context.resolveBinding(elements.get(0));
        StringBuilder b = new StringBuilder("(");
        for (String element : elements)
            b.append(context.resolveBinding(element)).append(", ");
        b.setLength(b.length() - 2);
        b.append(")");
        return b.toString();
    }
If none of the dimensions change order after rename we can do a simple rename.
vespajlib/src/main/java/com/yahoo/tensor/functions/Rename.java