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
6 votes
1 answer
940 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
2 answers
561 views

VQE Cirq example

Is my understanding correct that in this example the Hamiltonian measurement is not performed through measuring individual Pauli operators because all its terms are mutually commuting? So, for each ...
mavzolej's user avatar
  • 1,830
1 vote
1 answer
121 views

Bit Flip, Separable state and Several Question about Cirq

1)I want to use noise model for my state and bit_flip is not defined on cirq. ...
quest's user avatar
  • 614
6 votes
2 answers
1k views

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 + \...
Ashy's user avatar
  • 375
5 votes
3 answers
5k views

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

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's user avatar
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
4 votes
1 answer
441 views

How to add noise to existing gates in Cirq?

I would like to add noise to existing gates in Cirq, i.e. to define something like NewGate = cirq.Gate(qubit) followed by ...
user52305'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
3 votes
1 answer
213 views

Multiplying quantum circuits in cirq using * and computing "expectation values"

I am reading cirq guide about Simulation and there is an example in "Expectation values" paragraph that I don't understand. Everything boils down to the following snippet: ...
Fallen Apart's user avatar
3 votes
1 answer
383 views

How to use Cirq to transpile circuit to custom native gate set?

I am trying to use Cirq to compile arbitrary quantum circuits to custom native gate sets, e.g., to use the Cirq compiler to generate quantum circuits for different quantum computers (IBM, Rigetti, ...
nils's user avatar
  • 33
2 votes
1 answer
309 views

How to cite cirq in a scientific article?

What would be the best/prefered bibtex entry for citing cirq ? Is this ok ? ...
joaquin keller'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
1 vote
1 answer
236 views

Expectation value of an arbitrary observable. My own definition and `cirq` limitations

In my previous question I was struggling with the definition of expectation value of an observable for a circuit. Here is what I have derived after some support (I simplify the definition to 2-qubit ...
Fallen Apart's user avatar
1 vote
1 answer
224 views

Producing $|ghz\rangle\langle ghz|$ State in Cirq

I could manage to produce 3 qubit ghz state in Cirq. But I don't know how I can produce $|GHZ\rangle\langle GHZ|$ in Cirq Here is my code for 3 qubit ghz state Can you help me please for improving my ...
quest's user avatar
  • 614
1 vote
1 answer
536 views

Is there a quantum circuit builder package that allows you to import/export a circuit as a JSON?

I've done a superficial search in each of the qiskit, cirq, and braket open source repositories for such a feature, but can't find any explicit examples of this functionality. I'm wondering if anyone ...
Jay Muntz's user avatar
  • 147
0 votes
1 answer
121 views

Best way to compute $\langle a|B|a \rangle$ in Cirq, where a is a state obtained running circuit A. And B is a different Quantum Circuit

I am implementing RQAOA in Cirq. After running regular QAOA to find an optimal state a (This I have done successfully). I need to calculate $\langle a|Z_iZ_j|a\...
GuusH's user avatar
  • 13
0 votes
1 answer
116 views

$S^2$ expectation value of a circuit seems wrong

I need to rewrite a following circuit from Cirq to Qiskit with $2\varphi = \pi$. It's a circuit representing an initial state for VQE calculation. Considering, that ...
Eenoku's user avatar
  • 245
0 votes
1 answer
56 views

Multiple Bipartite Entangled State in Cirq

I am trying to create this state: rho = = q . rho_{1,2} + r . rho_{2,3} + s . rho{1,3} + (1-q-r-s) . rho_separable And I wrote this code: ...
quest's user avatar
  • 614