Skip to content
New issue

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

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

Already on GitHub? # to your account

CircuitPermMPS does not support created from_raw. #285

Open
lucas-slattery opened this issue Feb 27, 2025 · 0 comments
Open

CircuitPermMPS does not support created from_raw. #285

lucas-slattery opened this issue Feb 27, 2025 · 0 comments
Labels

Comments

@lucas-slattery
Copy link

What happened?

following code fails to apply_gate for the gate when using CircuitPermMPS. This is because CircuitPermMPS uses copy_with() method in the Gate class to update the qubits the gate should act on for the lazy indexing. copy_with() only works for gates that are registered and not created from raw.

What did you expect to happen?

apply_gate should work for gates created from_raw.

Minimal Complete Verifiable Example

`import quimb.tensor as qtn
import numpy as np

U = np.eye(2)
where = (1,)

gate = qtn.Gate.from_raw(U,where)
psi0 = qtn.MPS_computational_state('10001')

circuit_mps = qtn.CircuitMPS(5,psi0=psi0)
circuit_mps.apply_gate(gate)

circuit_perm_mps = qtn.CircuitPermMPS(5,psi0=psi0)
circuit_perm_mps.apply_gate(gate)`

Relevant log output

Anything else we need to know?

No response

Environment

latest

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant