Comments (3)
No problem. I might add that this is a good convention to follow because, were we to do it left-to-right, the basis elements would change if you add a qubit to the system. The index of the |1>
state in a 1-qubit system is the same as the index of the |0001>
state in a 4-qubit system. In the left-to-right scheme, we would have |1>
be indexed by 1, but |1000>
be indexed by 8, which seems silly. :)
from pyquil.
Hello! Thanks for the report.
The qubit indexes in Quil correspond to the exponents in the binary expansion of the basis index. Or, in other words, you should read the binary numbers right-to-left. So
X 0
X 1
would be the |011>
state, because
011 (binary) = 3 (decimal) = 0*2^2 + 1*2^1 + 1*2^0
The exponents of the radix 2
are precisely the qubit indexes.
It is important to note that some sciences do use other conventions here, which is important to be mindful of when writing Quil.
from pyquil.
Ah of course; thanks for the clarification!
from pyquil.
Related Issues (20)
- Python version should be `^3.8,<3.13`
- Defgate matrices should be type np.complex_
- _convert_to_py_instruction is non-exhaustive
- Typo in `RZZ` docs HOT 1
- DEFCIRCUIT cannot parse a definition on fixed qubits
- CompilerISA.dict() uses wrong field names
- Cannot pickle Frame objects under certain circumstances
- quil.Instruction are recognized as any AbstractInstruction subclass by isinstance.
- Support executing a program with a batch of memory maps
- Check for existing DefMeasureCalibration before adding
- Benchmark performance of program instruction iteration
- Waveforms cannot be pickled
- Support grpc-web HOT 1
- Implement experimental Rust backend to address performance issues w/ large number of instructions
- Forward `quil`'s Program schedule analysis features to pyQuil's Program
- UnknownApiError on get_qc("2q-noisy-qvm") call HOT 1
- `pyquil` is incompatible with `pyzx` because it depends on an old version of `lark`
- Update qcs-sdk-python/quil to pull in CalibrationSet improvements
- Program equality is too strict
- Pyquil 4.9 break expressions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyquil.