-
Notifications
You must be signed in to change notification settings - Fork 20
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
[Draft] Expansion of Observable_config #664
base: main
Are you sure you want to change the base?
Conversation
Please rebase the branch on main. A previous PR of mine modified the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #664 +/- ##
==========================================
- Coverage 85.79% 85.78% -0.02%
==========================================
Files 197 197
Lines 16971 16984 +13
Branches 1452 1453 +1
==========================================
+ Hits 14561 14570 +9
- Misses 1994 1998 +4
Partials 416 416 ☔ View full report in Codecov by Sentry. |
Thanks. Not very comprehensive, but some of the things here are being discussed in the PR here where the configs were introduced. Might give some insight into why certain things were done. (Having said that, feel free to just ask instead of going on a wild chase). |
qadence/constructors/hamiltonians.py
Outdated
def ising_hamiltonian_config( | ||
x_scale: TParameter = 1.0, | ||
x_shift: TParameter = 0.0, | ||
x_transformation_type: ObservableTransform = ObservableTransform.NONE, # type: ignore[assignment] | ||
zz_scale: TParameter = 1.0, | ||
zz_shift: TParameter = 0.0, | ||
zz_transformation_type: ObservableTransform = ObservableTransform.NONE, # type: ignore[assignment] | ||
trainable_transform: bool | None = None, | ||
) -> List[ObservableConfig]: | ||
zz_ham = zz_hamiltonian_config( | ||
scale=zz_scale, | ||
shift=zz_shift, | ||
transformation_type=zz_transformation_type, | ||
trainable_transform=trainable_transform, | ||
) | ||
x_ham = ObservableConfig( | ||
detuning=X, | ||
scale=x_scale, | ||
shift=x_shift, | ||
transformation_type=x_transformation_type, | ||
trainable_transform=trainable_transform, | ||
) | ||
return [zz_ham, x_ham] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be changed to return a single config that when the user passes to QNN.from_configs
gives you the Ising Hamiltonian as the observable instead of giving us a list of 2 ObservableConfigs, which would result in the QNN giving 2 outputs, one for the ZZ as observable, and the other as X as observable. See ising_hamiltonian.
No description provided.