With the current implementation, the projection circuits grow exponentially with the number of actual tree levels (that cannot be compressed into tensor factors). This is because the result of each child is uncomputed again after computing the result of the parent
Subspace("000") & (Subspace("##") | (Subspace("#") | Subspace("0")))
circuit:
X(target=(2,))
X(target=(7,), control=(2,))
X(target=(7,), control=(2,))
X(target=(2,))
X(target=(1,), control=(2,))
X(target=(8,), control=(1, 2))
X(target=(8,), control=(1, 2))
X(target=(1,), control=(2,))
X(target=(0,), control=(1, 2))
X(target=(8,), control=(0, 1, 2))
X(target=(8,), control=(1, 2))
X(target=(0,), control=(1, 2))
X(target=(8,), control=(2,))
X(target=(7,), control=(8, 2))
X(target=(7,), control=(2,))
X(target=(8,), control=(2,))
X(target=(0,), control=(1, 2))
X(target=(8,), control=(1, 2))
X(target=(8,), control=(0, 1, 2))
X(target=(0,), control=(1, 2))
X(target=(1,), control=(2,))
X(target=(8,), control=(1, 2))
X(target=(8,), control=(1, 2))
X(target=(1,), control=(2,))
X(target=(7,))
X(target=(3,))
X(target=(4,))
X(target=(5,))
X(target=(6,), control=(7, 3, 4, 5))
X(target=(6,))
X(target=(5,))
X(target=(4,))
X(target=(3,))
X(target=(7,))
X(target=(1,), control=(2,))
X(target=(8,), control=(1, 2))
X(target=(8,), control=(1, 2))
X(target=(1,), control=(2,))
X(target=(0,), control=(1, 2))
X(target=(8,), control=(0, 1, 2))
X(target=(8,), control=(1, 2))
X(target=(0,), control=(1, 2))
X(target=(8,), control=(2,))
X(target=(7,), control=(2,))
X(target=(7,), control=(8, 2))
X(target=(8,), control=(2,))
X(target=(0,), control=(1, 2))
X(target=(8,), control=(1, 2))
X(target=(8,), control=(0, 1, 2))
X(target=(0,), control=(1, 2))
X(target=(1,), control=(2,))
X(target=(8,), control=(1, 2))
X(target=(8,), control=(1, 2))
X(target=(1,), control=(2,))
X(target=(2,))
X(target=(7,), control=(2,))
X(target=(7,), control=(2,))
X(target=(2,))
This is of course good to reduce the number of needed ancillas, but on real hardware the number of bits is not the limiting factor, rather the number of operations.
With the current implementation, the projection circuits grow exponentially with the number of actual tree levels (that cannot be compressed into tensor factors). This is because the result of each child is uncomputed again after computing the result of the parent
unitaria/src/unitaria/subspace.py
Lines 384 to 386 in bf4bb21
This is of course good to reduce the number of needed ancillas, but on real hardware the number of bits is not the limiting factor, rather the number of operations.
Subspaces corresponding to
Subspace.from_dimare especially inefficient. In the above case corresponding to dim=7 it would have been enough to exclude the 111 case.