jcmgray / quimb

A python library for quantum information and many-body calculations including tensor networks.
http://quimb.readthedocs.io
Other
455 stars 107 forks source link

Circuit.apply_gate does not work with Gate #135

Closed lm1909 closed 1 year ago

lm1909 commented 1 year ago

What happened?

Using Circuit.apply_gate() with a parameter gate_id of type Gate results in a reference before assignment error being raised.

What did you expect to happen?

The gate should be applied to the circuit.

Minimal Complete Verifiable Example

No response

Relevant log output

No response

Anything else we need to know?

The reason is gate in https://github.com/jcmgray/quimb/blob/97a874619d7e31d5fb3bb20a8485d5cea23c7300/quimb/tensor/circuit.py#L923 which needs to be gate_id.

Environment

Latest version of quimb, commit 97a874619d7e31d5fb3bb20a8485d5cea23c7300.