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.

Filter by
Sorted by
Tagged with
0
votes
1answer
33 views

How to do a $C-PH$ gate in google cirq

I know that I can just use the $RZ$ gate to replace the $PH$ phase gate. But I need a way to implement the controlled phase gate $C-PH$ this cannot just be replaced with a $CRZ$ gate.
2
votes
0answers
22 views

Estimate run time of Cirq circuit on forthcoming Google quantum computer

Calling cirq.Simulator().run(..) on your circuit to get an idea of how it'd behave if you were to run on Google's (apparently) forthcoming real hardware is fine and dandy. Is there a way to estimate ...
3
votes
0answers
88 views

Quantum Optimization via Quantum Label Classification in Quantum Circuits

I have been reading Farhi and Neven's paper on quantum neural networks on quantum circuits. I also found an example - albeit not ideal as pointed out by a couple of users - thank you - in here. ...
1
vote
2answers
35 views

GridQubit in Cirq vs LineQubit

It's perhaps a very silly question, but in what ways is it advantageous to use GridQubit vs LineQubits to develop quantum circuits? Specially to develop ansatz ? Are GridQubits Cirq's way of ...
4
votes
1answer
91 views

How to implement NM Algorithm for Variational Quantum Eigensolver?

First of all: thanks for reading again. I appreciate the feedback I have gotten from this community the past weeks as I started to feel ready to ask questions about quantum computing topics. I am ...
2
votes
0answers
44 views

Measuring the expected energy of a quantum circuit

I implemented the following circuit: I am interested in measuring the expected energy of the circuit. I am using Cirq. I am wondering what are the next steps. Sorry if the question seems very basic, ...
3
votes
1answer
74 views

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 ...
1
vote
1answer
68 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$?
3
votes
1answer
164 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 ...
2
votes
2answers
81 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)$.
3
votes
1answer
192 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
73 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 ...
4
votes
1answer
41 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/...
5
votes
1answer
82 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 ...
3
votes
1answer
68 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? ...
1
vote
1answer
62 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
51 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
39 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 ...
2
votes
1answer
76 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 \ = ...
6
votes
1answer
194 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 $...
2
votes
0answers
82 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
55 views
1
vote
2answers
129 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.
3
votes
2answers
225 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.
5
votes
1answer
369 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 ...
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, ...