Questions tagged [pyquil]

A Python library for quantum programming using Quil. http://docs.rigetti.com

Filter by
Sorted by
Tagged with
5 votes
1 answer
324 views

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?
user avatar
1 vote
1 answer
71 views

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 ...
user avatar
2 votes
1 answer
44 views

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: ...
user avatar
0 votes
1 answer
453 views

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 ...
user avatar
2 votes
0 answers
59 views

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 ...
user avatar
2 votes
0 answers
56 views

Error during Forest openfermion installation

I tried installing Forest openfermion by pip install forestopenfermion and I got the following long error message (cut): ...
user avatar
3 votes
1 answer
197 views

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 ...
user avatar
6 votes
1 answer
802 views

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 ...
user avatar
  • 61
6 votes
2 answers
1k views

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 ...
user avatar
13 votes
2 answers
421 views

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 + [...] + - ...
user avatar