Questions tagged [cirq]

A python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits. It is a Python library for writing, manipulating, and optimizing quantum circuits and running them against quantum computers and simulators.

185 questions
13
votes
3 answers

What are physically allowed CNOTs for Rigetti's 19 qubit chip and Google's 72 qubit BristleCone chip?

For each IBM quantum chip, one can write a dictionary mapping each control qubit j to a list of its physically allowed targets, assuming j is the control of a CNOT. For example, ibmqx4_c_to_tars = { 0: [], 1: [0], 2: [0, 1, 4], 3:…
rrtucci
  • 689
  • 6
  • 14
11
votes
2 answers

Is Qiskit more popular than cirq? Why?

It seems like most people are using Qiskit, what's the difference?
nighthawk30
  • 121
  • 1
  • 4
9
votes
1 answer

In Cirq, how do you display circuit diagrams that are "prettier" than the ones displayed by default?

This is a duplicate of a question that was asked on the Cirq issues page. I'm duplicating this question to increase it's visibility.
Victory Omole
  • 2,332
  • 1
  • 10
  • 24
8
votes
1 answer

Is there a mistake in the VQE Ansatz in Cirq's tutorial?

I have been going through Cirq's VQE background tutorial and after examining the Ansatz it seems to me that the only layer that actually affects the final measurement is the rot_x_layer. The other layers simply act on the phases and therefore seem…
dncolomer
  • 148
  • 6
7
votes
3 answers

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: q0 = cirq.GridQubit(0,0) q1 = cirq.GridQubit(0,1) phi = sp.Symbol('phi') alpha = sp.Symbol('alpha') beta = sp.Symbol('beta') circuit = cirq.Circuit([ …
6
votes
2 answers

How to prepare a specific initial state of three qubits?

I would like to prepare the following initial state for variational quantum algorithms: $$ \sin\theta_1 \sin\theta_2 \sin\theta_3 |000\rangle + \sin\theta_1 \sin\theta_2 \cos\theta_3 |001\rangle + \sin\theta_1 \cos\theta_2 |010\rangle + \cos\theta_1…
Ashy
  • 395
  • 1
  • 7
6
votes
1 answer

Using parametrised values and 'Symbols' in Cirq

I'm just wondering how one should go about using parametrised values and the Symbol object that gets resolved at runtime? For example, if I would like to implement the gate $R_x(\theta) = e^{-i\theta/2}$, but would like to leave $\theta$ as a Symbol…
QC90
  • 61
  • 1
6
votes
1 answer

Why is this implementation of the order finding algorithm not working?

I asked a question about this earlier, but I am still coming across problems in my algorithm implementation. I am trying to implement the order finding algorithm on Cirq finding the minimal positive $r$ for coprime $x$ and $N$ satisfying the…
Jack Ceroni
  • 1,000
  • 7
  • 17
5
votes
1 answer

Moments-based quantum circuit in Cirq

In Cirq, quantum circuit consists of moments, which in turn consists of operations. This is different from Qiskit/OpenQASM, which doesn’t have the concept of moments. What is the design philosophy behind the moment-based quantum circuit? What are…
Junye Huang
  • 712
  • 8
  • 18
5
votes
3 answers

Overview of Cirq, qiskit, q#, ibmq(circuit board), other

What is the difference between these frameworks or languages? What are the pros and cons of each of these? Do you know any similar framework/platform/language that gives some more advantages?
Rishwi binnu
  • 173
  • 2
  • 10
5
votes
2 answers

N-Toffoli on Cirq

I am looking for guidance in more generally how to developed n-bit gates in Cirq. I am working on a QNN paper and I need to develop a n-controlled gate to be able to measure the cost function of the circuit.
Enrique Segura
  • 1,011
  • 6
  • 9
5
votes
1 answer

How to set a starting state in cirq?

I'm learning how to use the cirq library. Every time I set up a circuit the starting state of the qubits is $|0000..0\rangle$. Is there any way to make the starting state different? I'm thinking of somehow giving as input some np.array (vector) to…
Apo
  • 575
  • 2
  • 10
5
votes
1 answer

Where does the Xmon simulator from Googles cirq framework its entropy from?

Measurements create entropy as we all know. But computers themselves are deterministic machines. Most devices use processor heat as a source for random number generation as far as I know - which has lead to problems in the past. Any cryptographic…
sycramore
  • 339
  • 1
  • 10
5
votes
1 answer

List of qubit locations with cirq

As far I understand, qubits in cirq are labelled by their positions on chip. For example print( cirq.google.Foxtail.qubits ) yields frozenset({GridQubit(0, 1), GridQubit(1, 9), GridQubit(0, 2), ... I would like to get a simpler version of the…
James Wootton
  • 11,700
  • 1
  • 35
  • 74
5
votes
1 answer

Bloch sphere visualization using Cirq, ProjectQ, PyQuil

Is there a way to visualize the Bloch sphere using Cirq, ProjectQ, and/or PyQuil, as it is possible using plot_bloch_vector in Qiskit?
1
2 3
12 13