-
Notifications
You must be signed in to change notification settings - Fork 2
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] Add sample, Use single precision by default #16
Conversation
Hey @dominikandreasseitz, I'm working on fixing this PR. One thing that came up is that in (Pdb) hamevo
_HamiltonianEvolution(generator_name='I', target=((0, 1),), control=((None,),)) Just wondering what is the rationale behind the setting of @staticmethod
def parse_idx(
idx: Tuple,
) -> Tuple:
if isinstance(idx, (int, np.int64)):
return ((idx,),)
elif isinstance(idx, tuple):
return (idx,)
else:
return (idx.astype(int),) which makes |
Hi @Roland-djee , the reason for the tuple of tuples design choice lies in the apply_gate function which can be either applied to a single gate or an arbitrary number of gates. To do so, the operators and supports are collected in a single tuple and then get applied in a single lambda expression. The "collection" part assumes a tuple of tuples for supports so thats the story behind that. I get its a bit counterintuitive but its part of legacy horqrux so i was hesitant to change it since the function is quite useful |
Hey @RolandMacDoland I think I managed to fix this MR. What do you think? |
Oh, wow cool thanks. Please feel free to request a review :) |
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.
Thanks @chMoussa. Looking good. Few comments for the sake of discussion.
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.
LGTM. Minor renaming quibble. I think it is conventional in torch to have vparams
and fparams
to disambiguate.
Closes #18