Skip to content

Commit 7033aa5

Browse files
committed
update to use new random
1 parent 54f26c3 commit 7033aa5

File tree

1 file changed

+2
-9
lines changed
  • src/group/stabchain/base_change_builder

1 file changed

+2
-9
lines changed

src/group/stabchain/base_change_builder/random.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,12 @@ use crate::DetHashSet;
33
use crate::{
44
group::{
55
orbit::abstraction::{FactoredTransversalResolver, TransversalResolver},
6-
random_perm::RandPerm,
76
stabchain::{base::Base, Stabchain, StabchainRecord},
8-
Group,
97
},
108
perm::{actions::SimpleApplication, Action, Permutation},
119
};
1210
use num::BigUint;
1311

14-
const MIN_SIZE: usize = 11;
15-
const INITIAL_RUNS: usize = 50;
16-
1712
/// Helper struct, used to build the stabilizer chain
1813
pub struct RandomBaseChangeBuilder<P, A = SimpleApplication<P>>
1914
where
@@ -40,19 +35,17 @@ where
4035
V: TransversalResolver<P, A>,
4136
{
4237
let target_order = chain.order();
43-
let sgs = Group::from_list(chain.strong_generating_set());
4438
// Create the trivial chain with all the new base points.
4539
self.chain = base
4640
.base()
4741
.iter()
4842
.cloned()
4943
.map(StabchainRecord::trivial_record)
5044
.collect::<Vec<_>>();
51-
//Random permutation generator.
52-
let mut rand_perm = RandPerm::new(MIN_SIZE, &sgs, INITIAL_RUNS, rand::thread_rng());
45+
let mut rng = rand::thread_rng();
5346
//Loop till the new chain has the correct order.
5447
while self.current_chain_order() < target_order {
55-
let g = rand_perm.random_permutation();
48+
let g = chain.random_element(&mut rng);
5649
let (g_dash, i) = self.residue_with_dropout(g);
5750
//If the permutation doesn't sift through then add it as a new generator at level i.
5851
if i < base.base().len() {

0 commit comments

Comments
 (0)