Questions tagged [cirq]

For questions about cirq, a python framework for quantum computing on Noisy Intermediate Scale Quantum (NISQ) computers.

Cirq is a python framework for creating, manipulating, optimizing and executing quantum circuits on Noisy Intermediate Scale Quantum (NISQ) computers and simulators.

10 questions
3
votes
1 answer

Decompose a Quantum Circuit in Cirq

I am working on Cirq and need to perform certain unitary operations on qubits. For that, I am using the MatrixGate() function in Cirq. Unlike Qiskit, I could not find any function like decompose or transpile to simplify the Unitary operation into…
2
votes
1 answer

Set random seed for cirq functions

I am working with cirq and use a random unitary for testing purposes with: random_matrix = cirq.testing.random_unitary(dim=4) where can can the random seed for this function be set, using random.seed(a=1) does not seem to do this.
Marsh
  • 41
  • 6
2
votes
1 answer

How do I implement a controlled Rx in Cirq/Tensorflow Quantum?

I am trying to implement a controlled rotation gate in Cirq/Tensorflow Quantum. The readthedocs.io at https://cirq.readthedocs.io/en/stable/gates.html states: "Gates can be converted to a controlled version by using Gate.controlled(). In general,…
Thomas Hubregtsen
  • 449
  • 1
  • 5
  • 22
2
votes
1 answer

How to take classical input in a Cirq circuit

I'm new to quantum computing and have been playing with Cirq as I read through Quantum Computation and Quantum Information by Nielsen and Chuang. One of the first interesting circuits in the text relates to quantum teleportation and I am attempting…
Tom Collier
  • 31
  • 1
  • 2
1
vote
1 answer

How to find out what `*` operator do on two objects from some library (cirq)?

I just started using python cirq library and I came across the following line of code in the tutorial: XX_obs = cirq.X(q0) * cirq.X(q1) I just want to find in the code what this * operator do on this two specific cirq objects. How to do so?
Fallen Apart
  • 723
  • 8
  • 20
1
vote
1 answer

Conflict of protobuf versions between tensorflow 2.3.1 and cirq

Currently started to learn TFQ and been trying to do this tutorial of tensorflow authors, but if I run the first line (!pip install -q tensorflow==2.3.1 --user) I get this error: ERROR: pip's dependency resolver does not currently take into…
Mina
  • 11
  • 1
  • 2
1
vote
1 answer

Multiclass classification using TensorFlow Quantum

I am running some examples and tests on TensorFlow Quantum (TFQ) and I am struggling to perform a multi-class classification. I will used the MNIST classification example as base (https://www.tensorflow.org/quantum/tutorials/mnist), since this is…
1
vote
0 answers

How to do the square root of X operation in Qiskit

I'm trying to do the Bell Inequality Test in Qiskit but to do that you need preform the controlled negative square root of X operation. An example of this in Cirq is cirq.CNOT(bob_ref, bob)**-0.5 I tried to do something similar in Qiskit and it…
1
vote
3 answers

\_tfq_simulate_ops.so not found while import tensorflow_quantum

Trying import of initial libraries related to tensorflow_quantum: import tensorflow as tf import tensorflow_quantum as tfq import cirq import sympy import numpy as np Getting error in 2nd line: File…
avani
  • 11
  • 4
-1
votes
1 answer

Python type error: unbound method dict.keys() needs an argument

I am trying to access the keys in my results_dict dictionary with an if statment in my _run method. Specifically I get the TypeError: unbound method dict.keys() needs an argument error on the if (gate.key) in results_dict.keys(): line. I tried just…