question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I tried this example code snippet : from here

`from pyquil.paulis import ID, sX, sY, sZ

Pauli term takes an operator “X”, “Y”, “Z”, or “I”; a qubit to act on, and

an optional coefficient.

a = 0.5 * ID b = -0.75 * sX(0) * sY(1) * sZ(3) c = (5-2j) * sZ(1) * sX(2)

Construct a sum of Pauli terms.

sigma = a + b + c print(“sigma = {}”.format(sigma))`

I get error with the a = 0.5 * ID line the following : ##TypeError: unsupported operand type(s) for *: 'float' and 'function'. Can’t understand why ? Any idea ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
am610commented, Mar 27, 2020

perfect, thanks. works

0reactions
applebycommented, Mar 28, 2020

I’m actually not that familiar with forest-benchmarking or grove. If you don’t get a response on slack by early next week, you might consider opening an issue in the forest-benchmarking repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pauli matrices - Wikipedia
Hermitian operators represent observables in quantum mechanics, so the Pauli matrices span the space of observables of the complex 2-dimensional Hilbert space.
Read more >
Pauli Operator - an overview | ScienceDirect Topics
A Pauli operator on N qubits has the form [12] cO1O2…ON, where each Oi ∈ {I,X,Y,Z} and c = j l (l =...
Read more >
Pauli matrices - Wikiversity
In physics, the Pauli matrices are a set of 2 × 2 complex Hermitian and unitary matrices. ... Usually indicated by the Greek...
Read more >
Pauli Matrices -- from Wolfram MathWorld
The Pauli matrices, also called the Pauli spin matrices, are complex matrices that arise in Pauli's treatment of spin in quantum mechanics.
Read more >
2.4: The Pauli Algebra - Mathematics LibreTexts
Let us consider the set of all 2×2 matrices with complex elements. The usual definitions of matrix addition and scalar multiplication by complex ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found