Comments (8)
half_turns=2
is the identity up to global phase. The "thing being turned" is the relative phase between the |0> and |1> states, which has increased by 180 degrees when half_turns=1.
Dave also found this terminology confusing/objection-worthy. I will keep track of whether more people find it confusing, and if there's too many we'll change it.
from cirq.
From discussions I've had with others on the team, at least 3 other people using Cirq have found this confusing. Two have reported adding bugs to their code due to misunderstanding what half_turns means. I suggest using `periods', with periods=1.0 corresponding to exactly the identity (not up to global phase).
from cirq.
How about "degrees" instead? cirq.RZ(qubit, 90)
from cirq.
What do people think of exponent
instead of half_turns
? That's unambigous.
from cirq.
I strongly agree with exponent
.
from cirq.
I think you should not need to know the specific convention of the gate in order to guess what the argument should be. For example, is cirq.RZ(theta) equal to
exp(i theta \sigma_z)
or
|0 >< 0 | + exp(i theta) |1 > < 1 |
In the first case, the period is \theta = \pi, while in the second case the period is \theta = \2 pi.
But if I specify theta = 0.5 periods , I know that in both cases I will get a Z gate.
from cirq.
cirq.RZ(theta)= exp(-i * Z * theta/2)
It's textbook definition.
from cirq.
This has now been fixed. cirq.ZPowGate
takes an exponent, and cirq.Rz
takes rads.
from cirq.
Related Issues (20)
- Replacing terminal measurements with identity gates causes the final state vector to have wrong normalization HOT 4
- equivalent `MSGate` and `XXPowGate` instances don't evaluate as such
- Controlled CCX / CCZ gates do not respect global shift
- Retire custom coverage scripts and use codecov reports instead HOT 5
- Make `InsertionNoiseModel` serializable HOT 6
- `random_rotations_between_grid_interaction_layers_circuit` output depends on the order of qubits in a pair HOT 2
- Adding tags to Circuit objects
- `resolve_parameters` is slow for `cirq.Duration` HOT 4
- Deprecate and remove `processor_ids` argument by v1.4 HOT 2
- Caching value_equality_values? HOT 3
- Pauli gate initialization is slower than other gates HOT 5
- Convert incremental coverage scripts to use json coverage report HOT 6
- pytest failing on code-server docker container HOT 1
- Issue with variable spaced QROM
- 'SingleQubitCliffordGate' object has no attribute '__name__' HOT 7
- router mishandling mid-circuit measurements HOT 17
- Documentation of FSimGate has incorrect phase convention HOT 4
- TComplexity fails for CustomProgrammableRotationGateArray HOT 1
- Formalize release process
- QSimcirq does not implement measurement noise HOT 4
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 cirq.