We have a set of N variables α=[α_1,α_2,...,α_N] minus the identity.
We define the set of substitutions of degree m with the tensor Tm[i_1,i_2,...,i_m] such that
α_{i_1}*α_{i_2}*...α_{i_m}=Tm[i_1,i_2,...,i_m].
The number of elements of the tensor is N^m.
The general substitution will work by iterating over all indices of the tensor for all the specified degrees m the sub_monomial() function
sub_monomial(mon1,α_{i_1}*α_{i_2}*...α_{i_m},Tm_{i_1,i_2,...,i_m},recursive=true);.
It has to be iterated until no possible substitutions are found.
Deciding when to stop is critical, we can easily fall in cyclical substitutions.
example 1
We define
α = [x,y,z]T1 = [y,x,z]mon1= x
then we have the following chain
- first iteration
x→y→x - second iteration
x→y→x - ...
This is because there was a closed path of substitutions. This must be avoided. How can we avoid it? There is any theory for it?
💡If the degree of each element of Tm[i_1,i_2,…,i_m] is strictly smaller than m then we do not have closed path of substitutions. This can be a first rudimentary check, but we are not considering all the possible substitutions, see next example.
example 2
We define
α = [x,y,z]T1 = [y,y,z]mon1= x
then we have the following chain
- first iteration
x→y
Here there are no closed path of substitutions in T1.
💡 We will write an algorithm for checking if there is any closed path and in case resolve it.
The program should work with these steps:
- Accept a tensor of substitutions
T. - Optimise the substitutions' tensor.
- Apply recursively the substitutions.
The optimisation step should return a T such that a recursive substitutions routine eventually stops.
Defined an array of variables α=[α_1,α_2,...,α_N] the elements of the substitutions tensor Tm must be Union{T, PolyVar{C}, Monomial{C}, Term{C, T}} we call this variables form.
Once decided how to deal with Polynomial{C,T} we should extend the substitutions to the whole MPolynomialLike.
It must be even possible to specify each element of Tm as a Tuple{Int} of at most (m+1)-element.
Each array will specify how to build the monomial to substitute.
example
T2[1,2]=(1,3,4)indicate the substitutionα_1α_2→α_3α_4.T2[1,2]=(1,4)indicate the substitutionα_1α_2→α_4.T2[1,2]=(7,4)indicate the substitutionα_1α_2→7*α_4.T2[1,2]=(2,0)indicate the substitutionα_1α_2→2.
When a susbstitution tensor is written in this form we will say it is in tuples form.
We must be able to specify the maximum degree m of the substitutions when calling the recursive substitution algorithm. In this case we have to specify a tuple of m different substitution tensors. In the case Tm is specified and T^(m-1) is not specified, T^(m-1) will be assumed to be T^(m-1)[i_1,...,i_{m-1}]=(1,i_1,...,i_{m-1}).
The optimisation steps consist in expressing the substitutions tensors in standard form and then optimising it in order to avoid closed substitution cycles.
The standard form of the substitution tensor has the same structure for every value of m. Each element of Tm is a 3-element tuple with:
-
first element equal to the first element of the tuple of the tuple form,
-
second element equal the degree of the substitution,
-
third element equal to the linear index associated to the cartesian index encoded in the other elements of the tuple in the tuple form.
example
Consider the
3x3substitution tensorT2associated to the variables vectorα=[α_1,α_2,α_3].
The following are the representation of the same element in different forms:- variables form →
T2[1,2]=7*α_2α_3, - tuple form →
T2[1,2]=(7,2,3), - standard form →
T2[1,2]=(7,2,8);
- variables form →
or
- variables form →
T2[1,2]=5*α_2, - tuple form →
T2[1,2]=(5,2), - standard form →
T2[1,2]=(5,1,2).
or
- variables form →
T2[1,2]=5*α_2^2, - tuple form →
T2[1,2]=(5,2,2), - standard form →
T2[1,2]=(5,2,5).
or
- variables form →
T2[1,2]=5*α_2^2*α_3, - tuple form →
T2[1,2]=(5,2,2,3), - standard form → not admitted, the degree of the substitution is bigger then m.
For avoiding closed cycles we use the following algorithm on the standard form of Tm for every m.
- Set
index=1and the reset setting tocindex=[],coeffs=[],chain=0. - If
index=N^mthen finish. push!(cindex,index),push!(coeffs,1)andchain++
- If
Tm[cindex[chain]][2]>mthen refuse the substitution tensor. - If
Tm[cindex[chain]][2]<mthen thenindex++andset_chain(Tm,cindex,coeffs)andreset()and go to point 2. - If
Tm[cindex[chain]][2]=mthenpush!(cindex,Tm[cindex[end]][3]),push!(coeffs,Tm[cindex[end]][1])andchain++.
- Define
first=findfirst(x->x==cindex[chain],cindex)then
- If
first!=chain, thenindex++andset_cycle(Tm,cindex[first:chain],coeffs[first:chain])then, after set_cycleset_chain(Tm,cindex[1:(first)],coeffs[1:first]andreset()and then go to point 2. - If
first==chaingo to point 4.
function set_chain(Tm,cindex,coeff)
for i=1:(end-1)
Tm[cindex[i]][2:3] = Tm[cindex[end]][2:3];
Tm[cindex[i]][1] = prod(coeff[(i+1):end]);
end
endfunction set_cycle(Tm,cindex,coeff)
@assert prod(coeff)==1
set_chain(Tm,cindex,coeff)
end❓Is it possible to be blocked in the loop of point 4 and 5 forever?
It is important to check for all the Tm starting from the bigger m and moving to the smaller m
Figure1. This is the notation used.
Figure2. Representation of a possible set of substitutions.
Figure3. Substitutions after having solved cycles and chains.
🈺 This algorithm works for substitutions of MMonomialLike→MMonomialLike.
In the case one has to deal with substitutions of MMonomialLike→Polynomial there are different possibilities.
Suppose we are dealing with substitutions tensor of order m. Let us consider Tm[i_1,...,i_m]=P, where P is a Polynomial.
✅All the monomial in P of order smaller then m are accepted.
❌All the monomial in P of order bigger then m are not accepted and we will not accept T.
✅If in P there is a single monomial of order m than one runs the algorithm for MMonomialLike→MMonomialLikefollowing single monomials of order m.
❌If in P thare are more then one monomial of order m we will not accept the T.
Possibly multiple monomial of degree m and monomial of degree higher then m are acceptable. We should ask Marc-Olivier.
We consider the vector of Pauli operators α={X,Y,Z}.
We indicate with [A,B] and {A,B} respectively the commutator and anticommutator of A and B.
The commutation and anticommutation rules of this set are known.
Given [α_1,α_2] and {α_1,α_2} we know that α_1*α_2=([α_1,α_2]+{α_1,α_2})/2.
The set of substitutions of degree 1 is
T1=[_,_,_]
We can then build the set of substitutions of degree 2:
1 +iZ -iY
T2 = -iZ 1 iX
iY -iX 1
The degree of the elements of T is at most 1 thus there are no cyclic paths.
We can use it.
We consider the vector of Pauli operators α=[X_1,Y_1,Z_1,X_2,Y_2,Z_2].
The set of substitutions of degree 2 is the direct sum of the set of substitutions
of order 2 for α_1=[X_1,Y_1,Z_1] T2_1 and the set of substitutions of order 2
for α_2=[X_2,Y_2,Z_2] T2_2.
This sparsity should be exploited for bigger systems.