Hot answers tagged

5 votes
Accepted

How do you represent one-qubit rotations in two registers as a $4\times 4$ unitary matrix?

Note 100% sure if this is what you are asking but when you have a circuit like: and you want to write it as a $4 \times 4$ Unitary matrix $U$ then you can do it as: $ U = R_y(a[0]) \otimes R_z(a[1]) ...
KAJ226's user avatar
  • 13.6k
5 votes
Accepted

Does TensorFlow Quantum tfq.convert_to_tensor work on custom gates?

I'm the engineer who looks after TensorFlow Quantum. Serializing custom gates is not supported. There is an active issue on the GitHub here: https://github.com/tensorflow/quantum/issues/354 . A quick ...
Michael's user avatar
  • 393
5 votes
Accepted

Sympy suddently does not work together with TFQ

Just to add a little more context to your answer: TensorFlow-Quantum 0.4.0 has an explicit version dependency on sympy==1.5.0 in the ...
Michael's user avatar
  • 393
4 votes
Accepted

Encoding Numeric data as a quantum circuit in TFQ

I can lend some ideas, but since I don't know exactly what you're after I will have to guess a bit. Looking at the original snippet from the MNIST tutorial: ...
Michael's user avatar
  • 393
4 votes
Accepted

How to turn off multiprocessing in TensorFlow Quantum

There is no way to disable multiprocessing in TensorFlow Quantum without also affecting TensorFlow. That being said, there are still some workarounds to your problem that might be worth trying. It ...
Michael's user avatar
  • 393
3 votes

Cannot import tensorflow_quantum module in Colab

I believe Google Colab has been updated to use Python 3.10 as its default. You can check by running !python --version Tensorflow Quantum is only compatible with ...
ryanhill1's user avatar
  • 2,403
3 votes

How to learn parameters in a quantum circuit, given an interference pattern?

I think there might be a lot to unpack here. Just making sure my understanding of the problem is correct: I hand you a quantum circuit with some free parameters and then I hand you some samples from ...
Michael's user avatar
  • 393
3 votes

How do you represent one-qubit rotations in two registers as a $4\times 4$ unitary matrix?

The easiest way to get the unitary matrix of a couple of operations in Cirq is the unitary method on the Circuit class. In your ...
Balint Pato's user avatar
2 votes

Decomposition of the multi-controlled gate in tensorflow quantum

There is no decomposition being done for controlled operations by default. The library expects whatever simulator it is using to have support for the controlled_by ...
Michael's user avatar
  • 393
1 vote

Use parametrized quantum circuit output amplitudes for training in tensorflow

Using tfq.layers.State() you can directly access the state amplitudes and you do not need operators.
owen's user avatar
  • 11
1 vote

How to learn parameters in a quantum circuit, given an interference pattern?

Here's an update for those interested (& before I had read Michael's comment) I changed my problem around a bit, after discovering TFQ/cirq cannot (yet) handle serialising complex power-raised ...
Calum Macdonald's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible