Skip to main content
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.9k
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,503
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
  • 1,053
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
2 votes

Cannot Download TensorFlow Quantum

TensorFlow Quantum looks like it requires TensorFlow 2.11, you have 2.13 installed.Look at this install guide https://www.tensorflow.org/quantum/install. You also should check what python version you ...
Michael Watson's user avatar
1 vote

NotFoundError when import tfq

It looks like you are running into issues with the way you installed TensorFlow Quantum. You can have different issues dependent on whether you used for example pip or conda. This discussion may be of ...
ChristianM's user avatar
1 vote

Cannot import tensorflow_quantum module in Colab

Just run this: ...
Nice小夫's user avatar
1 vote
Accepted

Cannot Download TensorFlow Quantum

I think the issue is that you're on a windows machine. Based on the files present on pypi ( https://pypi.org/project/tensorflow-quantum/0.7.2/#files ), there's only linux and osx distributions of the ...
Craig Gidney's user avatar
  • 38.6k
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