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

[Feature] Allow time-dependent duration to be passed at runtime #605

Merged
merged 6 commits into from
Nov 11, 2024

Conversation

jpmoutinho
Copy link
Collaborator

@jpmoutinho jpmoutinho commented Nov 8, 2024

Following the MR on PyQTorch pasqal-io/pyqtorch#291, this MR brings this feature to Qadence as well.

from qadence import X, HamEvo, PI, add, run
from qadence import TimeParameter
import torch

n_qubits = 3

# Time-dependent Hamiltonian
t = TimeParameter("t")
hamiltonian = t * add(X(i) for i in range(n_qubits))
hevo = HamEvo(hamiltonian, parameter=t)
state = run(hevo, values = {"duration": torch.tensor(1.0)})

Note that I made it so there is a default duration = FeatureParameter("duration")

@jpmoutinho jpmoutinho added the feature New feature or request label Nov 8, 2024
@jpmoutinho jpmoutinho self-assigned this Nov 8, 2024
@vytautas-a
Copy link
Collaborator

Everything seems ok

@jpmoutinho jpmoutinho merged commit 8e24953 into main Nov 11, 2024
8 checks passed
@jpmoutinho jpmoutinho deleted the jm/duration_parameter branch November 11, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants