-
Notifications
You must be signed in to change notification settings - Fork 62
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
Update GST to take in gates.Unitary #1587
base: master
Are you sure you want to change the base?
Conversation
if isinstance(params, list): | ||
init_args = signature(gate).parameters | ||
valid_angles = [arg for arg in init_args if arg in angles] | ||
angle_values = dict(zip(valid_angles, params)) | ||
else: | ||
init_args = signature(gate).parameters | ||
valid_angles = [arg for arg in init_args if arg in matrix] | ||
angle_values = dict(zip(valid_angles, [params])) |
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.
if isinstance(params, list): | |
init_args = signature(gate).parameters | |
valid_angles = [arg for arg in init_args if arg in angles] | |
angle_values = dict(zip(valid_angles, params)) | |
else: | |
init_args = signature(gate).parameters | |
valid_angles = [arg for arg in init_args if arg in matrix] | |
angle_values = dict(zip(valid_angles, [params])) | |
if not isinstance(params, list): | |
params = [params] | |
init_args = signature(gate).parameters | |
valid_angles = [arg for arg in init_args if arg in angles] | |
angle_values = dict(zip(valid_angles, params)) |
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 @renatomello for spotting this. I have made the changes. But still trying to get it to work. It's currently complaining
FAILED tests/test_tomography_gate_set_tomography.py::test_GST[numpy-False-target_gates0] - ValueError: axes don't match array
FAILED tests/test_tomography_gate_set_tomography.py::test_GST[numpy-True-target_gates0] - ValueError: axes don't match array
FAILED tests/test_tomography_gate_set_tomography.py::test_GST[qibojit-numba-False-target_gates0] - ValueError: axes don't match array
FAILED tests/test_tomography_gate_set_tomography.py::test_GST[qibojit-numba-True-target_gates0] - ValueError: axes don't match array
Will keep trying to debug.
@@ -233,8 +235,7 @@ def GST( | |||
gate_set (tuple or set or list): set of :class:`qibo.gates.Gate` and parameters to run | |||
GST on. | |||
E.g. gate_set = [(gates.RX, [np.pi/3]), gates.Z, (gates.PRX, [np.pi/2, np.pi/3]), | |||
(gates.GPI, [np.pi/7]), gates.CNOT, | |||
(gates.Unitary, (np.array([[1,0],[0,1]])))] | |||
(gates.GPI, [np.pi/7]), gates.CNOT] |
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.
This docstring is generating a warning when the documentation is compiled because of identation. I fixed it in #1584. Please look at it to also fix it here.
Hi @MatteoRobbiati, I need some advice with this. When I run the pytests locally, they pass. But here, they always run into dimension error:
Could there be an issue with Thanks so much! |
Ehi @mho291! Thanks for asking :) |
Checklist: