Skip to content

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

@danlkv

Description

@danlkv

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions