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
4 votes
1 answer
92 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 ...
P.Windridge's user avatar
3 votes
0 answers
181 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. ...
Enrique Segura's user avatar
3 votes
2 answers
851 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 ...
Enrique Segura's user avatar
4 votes
1 answer
354 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 ...
Enrique Segura's user avatar
3 votes
0 answers
207 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, ...
Enrique Segura's user avatar
5 votes
2 answers
736 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 ...
Enrique Segura's user avatar
1 vote
1 answer
600 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$?
Victory Omole's user avatar
4 votes
1 answer
865 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 ...
Jack Ceroni's user avatar
4 votes
2 answers
486 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)$.
Reda Drissi's user avatar
3 votes
1 answer
2k 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 ...
Apo's user avatar
  • 543
4 votes
1 answer
2k 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 ...
Apo's user avatar
  • 543
5 votes
1 answer
337 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/...
QC90's user avatar
  • 51
5 votes
1 answer
226 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 ...
sycramore's user avatar
  • 190
4 votes
1 answer
242 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? ...
curiousStudent's user avatar
1 vote
1 answer
99 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 ...
Jack Ceroni's user avatar
1 vote
1 answer
125 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 ...
Jack Ceroni's user avatar
1 vote
1 answer
79 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 ...
Jack Ceroni's user avatar
2 votes
1 answer
347 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 \ = ...
Jack Ceroni's user avatar
6 votes
1 answer
944 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 $...
Jack Ceroni's user avatar
2 votes
0 answers
119 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 \ = \ ...
Jack Ceroni's user avatar
2 votes
1 answer
89 views

Is it possible to see how CompositeGates are decomposed when simulated using XmonSimulator?

I'm simulating a circuit like this: ...
Cheng Xing's user avatar
1 vote
2 answers
348 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.
Jack Ceroni's user avatar
4 votes
3 answers
1k 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.
Jack Ceroni's user avatar
5 votes
1 answer
535 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 ...
James Wootton's user avatar
13 votes
3 answers
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, ...
rrtucci's user avatar
  • 679

1 2 3
4