Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

12
votes
3answers
2k views

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, ...
5
votes
1answer
350 views

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 ...
5
votes
1answer
77 views

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 ...
5
votes
1answer
148 views

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 $...
4
votes
1answer
36 views

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/...
3
votes
1answer
116 views

Creating an ansatz for variational quantum algorithms?

I was recently reading through the tutorial on the Cirq documentation about creating variational quantum algorithms, and I came to the section on ansatz preparation. The way that the ansatz is ...
3
votes
2answers
190 views

How do I create my own unitary matrices that I can apply to a circuit in Cirq?

I am trying to simulate Deutsch's algorithm, and I need to apply the oracle function matrix to my circuit.
3
votes
1answer
127 views

How to add control to gates in Cirq?

My question is very simple. I know there is a method to add a control to previously defined gates. I saw in the API of cirq that there is a command Controlled gate (here). I'm not understanding though ...
3
votes
1answer
51 views

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 ...
3
votes
1answer
60 views

cirq.ControlledGate from sub-circuit generator

In Cirq, is it possible to take a sub-circuit generator and use it as the sub_gate in a cirq.ControlledGate? ...
2
votes
2answers
70 views

How is $X^q$ equal to $RX(\pi q)$?

I've seen in google cirq that a $X^q$ gate is converted in openqasm to $RX(\pi q)$, why is that? Same for $S^q$ into $RZ(\pi q/2)$.
2
votes
1answer
67 views

Is this the correct quantum circuit for the order-finding algorithm?

The algorithm is being implemented on Cirq, with the goal of finding the smallest $r$ for cooprime numbers $x$ and $N$ satisfying the equation $x^r \ = \ 1($mod $N)$. I have set $x \ = \ 2$ and $N \ = ...
2
votes
0answers
80 views

Would this quantum algorithm implementation work?

I am trying to implement the order finding algorithm on Cirq finding the minimal positive $r$ for coprime $x$ and $N$ satisfying the equation $x^r \ = \ 1$(mod$ \ N$). In my case, I have set $x \ = \ ...
2
votes
1answer
49 views
1
vote
2answers
111 views

Is it possible to create controlled gates with an exponent in Cirq?

Is it possible to create controlled gates with an exponent in Cirq? For example, a controlled $\sqrt Z$ gate.
1
vote
1answer
49 views

Why are these circuits not producing the expected output?

This circuit was created on the Quirk platform. I'm trying to implement a basic case of phase estimation. For some reason, I'm getting this strange result. When the Inverse QFT is broken down, it ...
1
vote
1answer
50 views

How do you start a simulation with a random initial state in Cirq?

How do you create a random initial state by modifying the $2^{n}$ vector amplitudes instead of starting every simulation at $|0000...000\rangle$?
1
vote
1answer
58 views

Why are these circuits not producing the same output?

I am simulating the phase shift algorithm on the Quirk platform. Even when the endian-ness of the built-in inverse QFT gate is corrected for, the circuits still output different results. Shouldn't the ...
1
vote
1answer
38 views

Do these outputs seem normal for the order finding algorithm?

I'm sorry for posting so many questions about this specific problem, but I just want to make sure that I am implementing an algorithm correctly. I am simulating the order finding algorithm (finding ...