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

Pass device to Hamiltonian, pass to pauli_string_to_matrix #292

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

yannick-couzinie
Copy link

pauli_string_to_matrix takes a device argument, which defaults to torch.device('cpu'):

def pauli_string_to_matrix(pauli: str, device=torch.device('cpu')) -> torch.Tensor:

When trying to use Hamiltonian on GPU this invariably leads to device errors, since the result from pauli_string_to_matrix will be on CPU, so it would be nice to be able to pass device to Hamiltonian, which passes it on to pauli_string_to_matrix. Setting the default to None ensures that not previous behaviour is changed.

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

Successfully merging this pull request may close these issues.

1 participant