Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource estimates change based on level of decomposition #20

Open
tyleratrigetti opened this issue Aug 14, 2024 · 0 comments
Open

Resource estimates change based on level of decomposition #20

tyleratrigetti opened this issue Aug 14, 2024 · 0 comments

Comments

@tyleratrigetti
Copy link
Contributor

Different levels of decomposition result in different resource estimates for the same circuit. Code snippet to demonstrate the problem is below. In this snippet, the Clifford count changes at decomposition level 3, and the T, Clifford, and logical qubits change at level 4.

The increase in logical qubits is due to the introduction of ancillae, so perhaps it is expected that resources count at the level of introduction of ancilla, but even before they are introduced, resource counts are not consistent during decomposition.

python version 3.9.10
pyLIQTR 1.2.0

from    pyLIQTR.qubitization.qsvt_dynamics                    import   qsvt_dynamics, simulation_phases
from   pyLIQTR.utils.resource_analysis                        import   estimate_resources
from    pyLIQTR.BlockEncodings.getEncoding                    import   getEncoding, VALID_ENCODINGS
from    pyLIQTR.ProblemInstances.getInstance                  import   getInstance
from pyLIQTR.clam.lattice_definitions import SquareLattice
from pyLIQTR.utils.circuit_decomposition import circuit_decompose_multi  



J      = -1.0;          N      =     2    
U      =  4.0;          shape  =  (N,N)

model  =  getInstance('FermiHubbard',shape=shape, J=J, U=U, cell=SquareLattice)
block_encoding    =  getEncoding(VALID_ENCODINGS.FermiHubbardSquare)(model)
times       =  1.0
eps         =  1e-3
phases      =  simulation_phases(times,eps=eps)
gate_qsvt   =   qsvt_dynamics( encoding=getEncoding(VALID_ENCODINGS.FermiHubbardSquare),
                               instance=model,
                               phase_sets=phases )

print(estimate_resources(gate_qsvt))
print(estimate_resources(circuit_decompose_multi(gate_qsvt.circuit,1)))
print(estimate_resources(circuit_decompose_multi(gate_qsvt.circuit,2)))
print(estimate_resources(circuit_decompose_multi(gate_qsvt.circuit,3)))
print(estimate_resources(circuit_decompose_multi(gate_qsvt.circuit,4)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant