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

Typo in mps_gate_with_mpo_lazy #246

Closed
hettahetta opened this issue Jul 17, 2024 · 1 comment
Closed

Typo in mps_gate_with_mpo_lazy #246

hettahetta opened this issue Jul 17, 2024 · 1 comment
Labels

Comments

@hettahetta
Copy link

What happened?

The function mps_gate_with_mpo_lazy calls tensor_network_apply_op_vec with parameters tn_op=mpo, tn_vec=mps, which results in an error. Correct way would be A=mpo, x=mps.

What did you expect to happen?

No response

Minimal Complete Verifiable Example

import quimb.tensor as qtn
import numpy as np

num_qubits = 5
psi = np.array([1, 0, 0, 0])
mps = qtn.MPS_product_state(
    [
        psi,
    ]
    * num_qubits,
    site_ind_id="q{}",
)
mpo = qtn.MPO_identity(num_qubits, phys_dim=4)

mps = qtn.tensor_1d_compress.mps_gate_with_mpo_lazy(mps=mps, mpo=mpo)

Relevant log output

1485 def mps_gate_with_mpo_lazy(mps, mpo, inplace=False):
   1486     """Apply an MPO to an MPS lazily, i.e. nothing is contracted, but the new
   1487     TN object has the same outer indices as the original MPS.
   1488     """
-> 1489     return tensor_network_apply_op_vec(
   1490         tn_op=mpo, tn_vec=mps, contract=False, inplace=inplace
   1491     )

TypeError: tensor_network_apply_op_vec() missing 2 required positional arguments: 'A' and 'x'

Anything else we need to know?

No response

Environment

quimb 1.8.3

@hettahetta hettahetta added the bug label Jul 17, 2024
@jcmgray
Copy link
Owner

jcmgray commented Jul 19, 2024

Thanks for finding this @hettahetta, will fix in a bit, unless you want to open an PR yourself.

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

No branches or pull requests

2 participants