A Python library for quantum programming using Quil. http://docs.rigetti.com
Questions tagged [pyquil]
15 questions
13
votes
2 answers
Hamiltonian simulation with complex coefficients
As part of a variational algorithm, I would like to construct a quantum circuit (ideally with pyQuil) that simulates a Hamiltonian of the form:
$H = 0.3 \cdot Z_3Z_4 + 0.12\cdot Z_1Z_3 + [...] +
- 11.03 \cdot Z_3 - 10.92 \cdot Z_4 + \mathbf{0.12i…
Mark Fingerhuth
- 1,125
- 7
- 13
6
votes
1 answer
How to create the oracle matrix in Grover's algorithm?
I'm trying to implement Grover's algorithm in pyQuil, but I'm having trouble creating the oracle matrix given the function $f$, where $f(x)=1$ if $x=w$ and $f(x)=0$ otherwise. In most of the implementations I've seen, either a mysterious oracle…
user5694
- 61
- 4
6
votes
2 answers
Measuring the Hamiltonian in the VQE
I am trying to implement VQE in pyQuil and am dumbfounded by how to measure the expectation value of a general Hamiltonian on $\mathbb{C}^{2^n}$ i.e. determine $\langle\psi , H \psi\rangle$ on a Quantum computer. As far as I understand on a real…
Jan Lukas Bosse
- 83
- 5
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?
Marija Scekic
- 145
- 4
3
votes
0 answers
Error during Forest OpenFermion installation
I tried installing Forest OpenFermion by
pip install forestopenfermion and I got the following long error message (cut):
Building wheels for collected packages: scipy
Building wheel for scipy (setup.py) ... error
ERROR: Command errored out with…
Michelle
- 31
- 1
3
votes
1 answer
Newbie Project: Calculate a Mersenne Prime with Quantum Computing
I am new to the quantum world and wondering the bounds of which the technology is at the current state of the art: specifically in computing prime numbers.
I would like to, if possible, create a project that seeks to find Mersenne prime numbers (see…
Daniel Connelly
- 133
- 2
3
votes
1 answer
Where can I find a comprehensive list of gate decompositions used by transpilers?
Does anyone know of a web site, paper etc. that has a list of "gate decompositions" e.g. the kind of decompositions that occur when the transpiler decomposes non-native gates to native gates.
This document is really nice and has some decompositions,…
John
- 207
- 1
- 5
2
votes
1 answer
Pyquil run_and_measure gives the same output across all the trials: is this expected?
I tried to run the starter program demonstrated on this page:
http://docs.rigetti.com/en/stable/start.html#installing-the-qvm-and-compiler-on-linux-deb
With the following code:
# construct a Bell State program
p = Program(H(0), CNOT(0, 1))
# run…
abracadabra12345
- 121
- 1
2
votes
0 answers
How to get the $T1$ specs for the Rigetti's quantum processor (Aspen 7)
I am trying to find the $T1$ coherence time for different qubits of Rigetti's quantum processor (Aspen 7) using Python. I tried using Specs() but encountered an error.
SHASHANK RANU
- 35
- 5
1
vote
2 answers
Can simulations of a quantum algorithm on a classical computer out-perform a classical algorithm?
Has it ever been shown that simulation of a quantum algorithm (e.g., using PyQuil or something?) on a classical computer has out-performed a purely classical algorithm? From what I can tell the answer is no, given the large memory, etc., for a…
IsalanOnkar
- 81
- 3
1
vote
1 answer
Which method does pyQuil use to compile a Program?
I want to find out which method different compilers use to decompose a matrix into smaller gates. I went through the pyQuil code on github but could not find the answer there. Maybe i lost track of something. I would by highly interested in the…
Qubii
- 301
- 1
- 7
1
vote
0 answers
Is there a method in pyQuil to create logical boolean gates
is there another way to represent a boolean gate. The straight forward way would be to define a gate my a matrix and then apply this gate to the circuit. What i mean by that? For Example an AND-Gate is nothing Else then a CCX-Gate. So we want Qubit1…
Qubii
- 301
- 1
- 7
1
vote
1 answer
How to create a qubit in an arbitrary state in PyQuil
In PyQuil, a qubit is initialised as $|0\rangle$ by default. Suppose, I want to initialise a qubit in an arbitrary state, say $\frac{1}{\sqrt{3}}|0\rangle+\sqrt{\frac{2}{3}}|1\rangle$. How to do this arbitrary qubit initialisation in PyQuil?
SHASHANK RANU
- 35
- 5
0
votes
1 answer
How to set different Backend Layouts in TKET and pyQuil (Quil compiler)?
In Qiskit it is possible to describe a CouplingMap on which a circuit get executed. This helps with testing different Layouts. There are many possibilities in Qiskit on how to do this. Firstly you can create a CouplingMapInstance and then create…
Qubii
- 301
- 1
- 7
0
votes
1 answer
VQE for Beginners : Using Tutorial and Cirq
I have been following this tutorial: https://dkopczyk.quantee.co.uk/vqe/
I am using Cirq to try to teach myself VQE, replicate their results, and also try to understand more about ansatz for molecular simulations - and just for plain fun!
Here's the…
Enrique Segura
- 1,011
- 6
- 10