Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Approximate Quantum Compiler #6727
Approximate Quantum Compiler #6727
Changes from all commits
8698317
f07fd5c
71115ac
f2f57f0
2a80c61
576e0fe
5899b84
7ffaa3b
5cd18dc
6b17eee
8ef89c9
3c0e979
a8af3e2
eca564b
c386858
c8d975c
913810f
635c5cd
f13228f
ad2efca
29f7331
01fcc5b
46d1470
2d4f2b2
158e3b9
ae1597e
e4e5492
bc4652b
27f9495
034586f
8d8d443
e78c110
ce408da
6a3c014
a3f1e89
5f2149e
38daa81
bb74b19
fba74f4
c7ccf59
8a3b6a4
f03b72c
6677115
481a381
ca6e0d5
2f29d14
a379af1
9965269
f0cb216
bfe1105
0fc591b
f8f083f
5f3d15a
885d8be
fa91883
76a40f5
fd13158
59084ff
466afcb
f5bc4f8
599cd3c
8a171ab
058dde4
0896573
441b305
eea8cc1
80f7663
6b81031
73c8b98
b9e41db
9fa1714
5394217
a0fba07
79852ea
ee6028a
e154e77
12584f9
008a4b2
ba6e9b4
1c5a22f
55ef2d7
9f372fc
76be97a
ce4952e
a07eea6
6eed3ad
ee71e94
f71f8c6
3168a92
2a06bf6
b79245f
37857b6
45302f8
7e7aab1
99a687f
1f8300a
7570021
f970bd4
60eb8b1
1e5ffc7
f7fcc23
86451e6
5ed7045
1fc9923
472ae2f
fab57ff
f897673
41cbad9
cb7587f
dd5fd05
da3bc91
12c7d13
edf039c
6ea3a23
72c4209
c9f6aa3
263b7ec
e7916c6
e45fb19
d8ffcc4
a866ef8
ab60db6
7e184b3
8d92cf7
9e8528e
554fb59
ac5aaee
dd100dd
f1bbad9
408168c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Im not fully sure why
target_matrix
cannot be set at construction time.compile_unitary
is called like thisWhy wouldnt be possible to do something like this?
In this way, you avoid the dependency
set target_matrix
before callingobjective
/gradient
.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'm also a little puzzled. I appreciate that it's often cheaper to re-use instances of numerical optimizers across calls with different objective parameters, and so I understand the impulse to defer setting the objective / allowing it to be mutable. Continuing that thought, I'd want to defer setting the target all the way up until I actually ask for optimization to happen. What's gained by saving it as part of the optimizer's state, available before and after optimization completes? Why not supply it only through the
.compile_unitary
call?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.
@1ucian0 It won't work this way. At least in the current design. Now, you pass an objective, a template circuit and a unitary to be optimized in the
aqc.compile_unitary()
call. The problem is that the unitary passed is may be updated inAQC
, now we normalize it before starting off optimization. So, there should be a way to update the matrix in the objective. OK, another option here is to create an objective, a template inside ofaqc.compile_unitary()
. But then you loose flexibility of passing a custom objective/template.@ecpeterson Sorry, I don't fully understand your comment. The target matrix is set just before optimization starts. Everything is as stateless as possible and deferred till the latest stages.
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'm not sure that this is correctly handling global phase: even among operators U whose determinant is normalized to 1, each still has four representatives up to phase: {U, 1j U, -U, -1j U}. Maybe it would be better to add global_phase as another variable over which to optimize? Since it commutes with any supplied optimization template, it should be possible to extend a user's supplied definition of the template gradient with a gradient which also accounts for this extra factor.
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.
That's right, there are many mapping
SU(d)
->U(d)
in this case and in overall we may end up with a sub-optimal solution instead of a optimal one. Currently, it is a limitation of the algorithm as initially we started from SU matrices. We are studying the ways how to get rid of global phase dependency and it may include consideration of other cost functions, e.g. a function that does not depend on global phase. This question definitely requires thoughtful exploration of various possibilities and we will address it in the next release.