Questions tagged [tfq]

TensorFlow Quantum (TFQ) is a quantum machine learning library for rapid prototyping of hybrid quantum-classical ML models. It integrates quantum computing algorithms and logic designed in Cirq and provides quantum computing primitives compatible with existing TensorFlow APIs and quantum circuit simulators.

Filter by
Sorted by
Tagged with
7 votes
3 answers
394 views

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

Using cirq, I have the following quantum circuit, with three parameters: phi, alpha and beta: ...
Calum Macdonald's user avatar
4 votes
1 answer
269 views

Does TensorFlow Quantum tfq.convert_to_tensor work on custom gates?

I'm trying to use Cirq with TensorFlow Quantum to simulate a variational quantum classifier. There's a tutorial on the TFQ website on building a quantum neural network to classify a simplified version ...
ryanhill1's user avatar
  • 2,503
3 votes
2 answers
199 views

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

Let's say you have a circuit that performs a Z-rotation in the first register, and a Y-rotation in second register. How can we express this "moment" in terms of a 4x4 matrix, i.e. a two-...
ryanhill1's user avatar
  • 2,503
3 votes
2 answers
245 views

Sympy suddently does not work together with TFQ

I work with tensorflow-quantum and use sympy for parameter updating. Suddenly, without (manually) updating or changing anything this error comes up: ...
eli44's user avatar
  • 165
3 votes
1 answer
372 views

How to turn off multiprocessing in TensorFlow Quantum

Some background: I'm currently running the same training algorithm with a classical neural network and a quantum circuit, respectively. The NN is implemented in Keras with a TensorFlow backend, the ...
skola's user avatar
  • 45
2 votes
1 answer
399 views

Encoding Numeric data as a quantum circuit in TFQ

I am working on a dataset where I have 6 input features that are numbers in the range of 1 - 1000 that need to be encoded as a quantum circuit. I am using TensorFlow Quantum for my research. While I ...
Lakshit Dabas's user avatar
2 votes
1 answer
118 views

Use parametrized quantum circuit output amplitudes for training in tensorflow

I am trying to train a quantum neural network in tensorflow_quantum (tfq). Using cirq.Circuit I have set up my circuit. I now need to wrap it in a keras model for ...
jesua israel epequin chavez's user avatar
2 votes
0 answers
36 views

How to take gradient of the `tfq.layers.State` output?

I am using the following code for building a quantum circuit as a custom tf.keras.layers.Layer: ...
Shuhul Handoo's user avatar
2 votes
0 answers
26 views

How to train the embedding of classical data as well as the classifier in TFQ?

I've got some classical training data, and, for the moment, each of these will have its own embedding parameters defining how it is inputted into a certain ansatz. What I'd like is a circuit in two ...
TIF's user avatar
  • 121
2 votes
0 answers
101 views

Does anyone know how to use TF Quantum with real hardware data?

I'm currently trying to embed a tensorflow model for denoising measurements as a tensorflow quantum model, and at some point I'd like for this to be able to run on hardware. After reading through all ...
Cuhrazatee's user avatar
2 votes
0 answers
139 views

How to convert a dataset of different values in [0,1000] to quantum data for training a model using Tensorflow QuantumHaving?

...
Alexander Makalovij's user avatar
1 vote
1 answer
104 views

Decomposition of the multi-controlled gate in tensorflow quantum

In TensorFlow Quantum 0.5.0, the support for Cirq gates that have arbitrary control via the gate.controlled_by function is added. I would like to know which kind of ...
DoubleFan's user avatar
1 vote
0 answers
49 views

Tensorflow_quantum hybrid models tf-quantum

I am trying to QCNN for MNIST classification equivalent to that built in. I’m having problems trying to pass my quantum circuit built with cirq as a Keras layer. Here’s what I have: ...
Kieran McDowall's user avatar
1 vote
0 answers
83 views

keras agents fails in DQNAgent using PQC during clonation for target

I have some issues using keras-rl2 with tensorflow_quantum and VQC (using identical architecture as https://www.tensorflow.org/quantum/tutorials/quantum_reinforcement_learning) After the creation of ...
Eva Andres's user avatar
1 vote
0 answers
104 views

Quantum Circuits for Time-Series Data

I am currently working with a dataset with autocorrelated features, i.e, x(t) affects the value of x(t+1) which affects the value of x(t+2). Suppose this is the circuit representing x(t): Does ...
Lakshit Dabas's user avatar
0 votes
2 answers
484 views

Cannot import tensorflow_quantum module in Colab

I was trying to install the tensor flow quantum module using the one given in their official website but it is showing these errors while installing. ...
Siddharth Sethi's user avatar
0 votes
1 answer
174 views

Cannot Download TensorFlow Quantum

Hey Quantum Computing community, I cannot get TensorFlow Quantum to work even though I am using pip install tensorflow-quantum I have TensorFlow already on Visual ...
Sid Meka's user avatar
0 votes
0 answers
178 views

tensorflow, tensorflow-quantum, tensorflow-federated latest version compatibility?

I have been working with on some research on tensorflow, tensorflow-quantum and tensorflow-federated and the problem with that is I just can't install those three at my google colab and I tried ...
Rayhan's user avatar
  • 143
0 votes
0 answers
173 views

Gradient registry has no entry for: TfqSimulateState

I am trying to calculate and optimize a loss with TFQ and cirq. Using tfq.layers.State() to work with statevector instead of its observables. But when I try to fit o get its gradient the following ...
Eva Andres's user avatar
-2 votes
1 answer
71 views

NotFoundError when import tfq [closed]

I tried to import tfq, but couldn't and got an error like this: NotFoundError: /home/ugisugih/anaconda3/envs/tfq_env/lib/python3.8/site-packages/tensorflow_quantum/core/ops/_tfq_simulate_ops.so: ...
Sugih Pratama Nugraha's user avatar