Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dwuggh
surfcode-rs
Commits
e722caf7
Unverified
Commit
e722caf7
authored
Aug 06, 2021
by
dwuggh
Browse files
aware of p_ext
parent
b16f8e95
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/controller.rs
View file @
e722caf7
...
...
@@ -32,8 +32,12 @@ fn get_weight(pd: f64, pm: f64) -> (f64, f64) {
w2
=
w2
/
wsum
;
}
// w1 = 0.
5
;
// w1 = 0.
1
;
// w2 = 1.0 - w1;
// p is w1 / w2
// let p = 10.;
// let w1 = p / (1. + p);
// let w2 = 1. / (1. + p);
log
::
info!
(
"w1: {}, w2: {}"
,
w1
,
w2
);
(
w1
,
w2
)
...
...
@@ -77,8 +81,9 @@ pub fn runner2(xn: usize, zm: usize, measure_rounds: usize, measure_model: Measu
// let p1 = 0.01;
let
probs
=
&
measure_model
.success.probs
;
let
p_ext
=
probs
[
1
]
*
4.
;
log
::
debug!
(
"p_ext: {}"
,
p_ext
);
let
(
w1
,
w2
)
=
get_weight
(
p1
+
p_ext
,
measure_model
.failure.prob_sum
);
log
::
info!
(
"p_ext: {}"
,
p_ext
);
let
(
w1
,
w2
)
=
get_weight
(
p1
+
p_ext
,
measure_model
.failure.prob_sum
+
p_ext
);
// let (w1, w2) = get_weight(p1 + p_ext, measure_model.failure.prob_sum);
let
channel
=
NoiseChannel
::
new_depolarizing_channel
(
p1
);
let
error_model
=
ErrorModel
::
new
(
channel
,
Some
(
measure_model
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment