-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from ChitambarLab/chsh-user-guide
Chsh user guide
- Loading branch information
Showing
15 changed files
with
520 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,102 @@ | ||
# User Guide | ||
|
||
## Quickstart | ||
|
||
```julia | ||
using Pkg; Pkg.add("BellScenario") | ||
julia> using Pkg; Pkg.add("BellScenario") | ||
``` | ||
|
||
```@example tutorial | ||
using BellScenario | ||
``` | ||
|
||
## CHSH Scenario | ||
|
||
The CHSH scenario is a [`BipartiteNonSignaling`](@ref) scenario where Alice and Bob | ||
each have a black-box with binary inputs and outputs. | ||
|
||
![Classical CHSH Scenario](assets/scenario_images/classical_chsh_scenario.png) | ||
|
||
This scenario is significant because it is the simplest Bell scenario in which | ||
quantum nonlocality can be observed. | ||
We will use BellScenario.jl to compute the CH Bell inequality and optimize quantum | ||
measurements to violate the CH inequality. | ||
First, create a CHSH `Scenario` to specify the black-box arrangement in the figure | ||
above. | ||
|
||
```@example tutorial | ||
# (num_out_A, num_out_B, num_in_A, num_in_B) | ||
chsh_scenario = BipartiteNonSignaling(2,2,2,2) | ||
``` | ||
|
||
Bell inequalities bound the set of local (classical) correlations. | ||
The local set is a convex polytope referred to as the *local polytope* and the | ||
facets of the local polytope are Bell inequalities. | ||
The standard method of computing Bell inequalities is to first compute the local | ||
polytope vertices, then apply a polytope transformation algorithm to compute the | ||
Bell inequalities. | ||
|
||
The BellScenario.jl package provides the [`LocalPolytope`](@ref) module to compute | ||
Bell inequalities. | ||
The first step is to commpute the vertex representation for the CHSH scenario. | ||
|
||
```@example tutorial | ||
chsh_polytope = LocalPolytope.vrep(chsh_scenario) | ||
``` | ||
|
||
Then, the Bell inequalities can computed using the [`LocalPolytope.facets`](@ref) | ||
function. | ||
|
||
```@example tutorial | ||
chsh_facets = LocalPolytope.facets(chsh_polytope) | ||
``` | ||
|
||
We'll take ``15^{th}`` facet as it represents the CH inequality | ||
|
||
```math | ||
- P_A(1|2) - P_B(1|1) + P(11|11) - P(11|12) + P(11|21) + P(11|22) \leq 0. | ||
``` | ||
|
||
In fact, this inequality is equivalent to the more celebrated CHSH inequality. | ||
The difference is that the CH inequality is expressed in terms of probabilities | ||
whereas the CHSH inequality is expressed in terms of bipartite correlators. | ||
|
||
```@example tutorial | ||
ch_inequality = chsh_facets[15] | ||
``` | ||
|
||
Now that we have computed a Bell inequality, we can find a quantum violation using | ||
the [`Nonlocality`](@ref) module. | ||
In this example, we will fix Alice's measurement and the quantum state shared | ||
between Alice and Bob. | ||
|
||
```@example tutorial | ||
# maximally entangled state | ||
ρ_AB = [1 0 0 1;0 0 0 0;0 0 0 0;1 0 0 1]/2 | ||
# Alice's measurement bases | ||
Π_ax = [ | ||
[[1 0;0 0], [0 0;0 1]], # Pauli Z basis | ||
[[1 1;1 1]/2, [1 -1;-1 1]/2] # Pauli X basis | ||
] | ||
``` | ||
|
||
Then, we convert the `ch_inequality` into a general representation of a [`BellGame`](@ref). | ||
|
||
```@example tutorial | ||
ch_game = convert(BellGame, ch_inequality, chsh_scenario) | ||
``` | ||
|
||
Finally, we optimize Bob's measurement with respect to the fixed state and measurements. | ||
|
||
```@example tutorial | ||
opt_dict = Nonlocality.optimize_measurement( | ||
chsh_scenario, ch_game, ρ_AB, A_POVMs=Π_ax | ||
) | ||
``` | ||
|
||
We see that the inequality is violated for the optimized measurement and states. | ||
|
||
```@example tutorial | ||
opt_dict["violation"] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
3b340de
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
3b340de
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/40090
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: