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

qtree circuit is a list of lists, but simulator takes a list of gates #44

Open
danlkv opened this issue Aug 14, 2023 · 0 comments
Open

Comments

@danlkv
Copy link
Owner

danlkv commented Aug 14, 2023

qtree code assumes that gates are grouped in "layers". The qtree circuits are lists of lists of gates. The layer information is not very useful, so in qtensor circuit is just a list of qtree gates.

This can cause the following error (for example when creating TensorNet):

File ".../qtensor/optimisation/TensorNet.py", line 63, in <listcomp>
    n_qubits = len(set(sum([g.qubits for g in all_gates], tuple())))
AttributeError: 'list' object has no attribute 'qubits'

In examples the conversion is mentioned, but ideally there shouldn't be a conversion involved.

n, qc = from_qiskit_circuit(qiskit_qaoa.circuit)
all_gates = sum(qc, [])
sim.simulate(all_gates)
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