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

TypeError: spins_to_tt_state() got an unexpected keyword argument 'dtype' #8

Open
MonitSharma opened this issue Mar 14, 2024 · 0 comments

Comments

@MonitSharma
Copy link

MonitSharma commented Mar 14, 2024

While running the Multi-Basis Encodig code, I got the error mentioned above.

state = tlq.spins_to_tt_state([0 for i in range(nqubits)], device=device, dtype=dtype) # generate generic zero state |00000>
state = tlq.qubits_contract(state, ncontraq) 

I checked the GitHub and found that the code is indeed correct, i.e it does take dtype as an argument :

def spins_to_tt_state(spins, device='cpu', dtype=complex64):
    """ Generates tt-tensor state of computational basis product space described by spins.

    Parameters
    ----------
    spins : List/tensor of ints (0's and 1's), spin values

    Returns
    -------
    tt-tensor product state in the computational basis
    """

Since I installed tensorly-quantum using a pip command, maybe a previous version was installed where this was an issue.

It works fine when I make use of the GitHub fork of the same repo, rather than the pip installed one.

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