Owen L

Results 338 comments of Owen L

Should just be a matter of `h2.set_weights(h1.get_weights())` whenever you want to do this (in training or whatever epochs or whatnot). I just tested that with H1 being a PQC based...

I see, that this was all happening in the custom layer was unclear. Here is an example of what I think you want, which can be achieved by just indexing...

If you apply gradients sequentially (i.e. take gradient for value, apply gradient, take gradient for energy, apply it), it will work and H1 params (which are just part of the...

You can access the H1 params just by indexing the layer weights (as I did in the call function). However, if you are taking the gradient and the function only...

Probably easiest to just make the H1 and H2 params separate variables since you are using them a lot independently it seems. The following does that, allowing just params of...

The same weights and circuits are fed into the controlled PQC so they should be the same in the __call__ function. Since the h1 circuit is pre defined and the...

Sure, you can just use a state layer (https://www.tensorflow.org/quantum/api_docs/python/tfq/layers/State). Just put in the circuit and parameters and it will give you the state. This isn't from a controlled PQC (since...

They should be distributed the same, since in controlled PQC and in state the param value is connected with a specific param name somewhere in the circuit (which is managed...

You want to get the probability from the output of tfq.state? If you are doing noiseless simulation you can just multiply the statevector by it's conjugate and that is the...