Skip to content

Optimising a gate with two parameters #133

Answered by lm1909
lm1909 asked this question in Q&A
Discussion options

You must be logged in to vote

Actually, I figured out that this is quite simple to workaround - by simply defining a PArray with a custom function. Conceptually something like:

def helper_function(params):
   return qtn.circuit.rz_gate_param_gen([params[0] * local_constant]])
circuit.apply_gate_raw(qtn.array_ops.PArray(helper_function, [shared_variable]), ..., parametrize=True)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lm1909
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant