-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9940772
commit 324472c
Showing
2 changed files
with
81 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ pip install --no-index --upgrade pip | |
pip install --no-index numpy scipy opt_einsum tqdm qecstruct more_itertools networkx | ||
pip install git+ssh://[email protected]/quicophy/matrex.git | ||
|
||
num_processes=4 # Number of processes to use in parallel | ||
|
||
# Define arrays of lattice sizes, bond dimensions, error rates, and seeds | ||
lattice_sizes=(13) | ||
bond_dims=(256) | ||
|
@@ -23,14 +25,10 @@ seeds=( | |
143 144 145 146 147 148 149 150 151 152 | ||
153 154 155 156 157 158 159 160 161 162 | ||
163 164 165 166 167 168 169 170 171 172 | ||
173 174 175 176 177 178 179 180 181 182 | ||
183 184 185 186 187 188 189 190 191 192 | ||
193 194 195 196 197 198 199 200 201 202 | ||
203 204 205 206 207 208 209 210 211 212 | ||
213 214 215 216 217 218 219 220 221 222 | ||
) # 100 random seeds | ||
num_experiments=10 # Per each random seed | ||
error_model="Bit Flip" # Error model used in the experiments | ||
) # 50 random seeds | ||
num_experiments=20 # Per each random seed | ||
error_model="Bitflip" # Error model used in the experiments | ||
bias_prob=0.001 # The decoder bias probability | ||
|
||
error_rates=() | ||
start=0.105 | ||
|
@@ -48,26 +46,24 @@ for seed in "${seeds[@]}"; do | |
for lattice_size in "${lattice_sizes[@]}"; do | ||
for bond_dim in "${bond_dims[@]}"; do | ||
for error_rate in "${error_rates[@]}"; do | ||
# Sanitize the error model name by replacing spaces with underscores | ||
sanitized_error_model=$(echo "${error_model}" | sed 's/ /_/g') | ||
# Define job script filename | ||
job_script="submit-job-${lattice_size}-${bond_dim}-${error_rate}-${sanitized_error_model}-${seed}.sh" | ||
job_script="submit-job-${lattice_size}-${bond_dim}-${error_rate}-${error_model}-${seed}.sh" | ||
# Create the job submission script | ||
cat > "$job_script" <<EOS | ||
#!/bin/bash | ||
#SBATCH --time=48:00:00 # Time limit (hh:mm:ss) | ||
#SBATCH --cpus-per-task=1 # Number of CPU cores per task | ||
#SBATCH --mem=64000 # Memory per node | ||
#SBATCH --job-name=decoding-${lattice_size}-${bond_dim}-${error_rate}-${sanitized_error_model}-${seed} # Descriptive job name | ||
#SBATCH --output=decoding-${lattice_size}-${bond_dim}-${error_rate}-${sanitized_error_model}-${seed}-%j.out # Standard output and error log | ||
#SBATCH --time=96:00:00 # Time limit (hh:mm:ss) | ||
#SBATCH --cpus-per-task=${num_processes} # Number of CPU cores per task | ||
#SBATCH --mem=16000 # Memory per node | ||
#SBATCH --job-name=decoding-${lattice_size}-${bond_dim}-${error_rate}-${error_model}-${seed} # Descriptive job name | ||
#SBATCH --output=decoding-${lattice_size}-${bond_dim}-${error_rate}-${error_model}-${seed}-%j.out # Standard output and error log | ||
module load python/3.11.5 | ||
source "$HOME/envs/myenv/bin/activate" | ||
# Run the Python script with the specified arguments | ||
python examples/decoding/quantum_surface.py --lattice_size ${lattice_size} --bond_dim ${bond_dim} --error_rate ${error_rate} --num_experiments ${num_experiments} --error_model "${error_model}" --seed ${seed} | ||
python examples/decoding/quantum_surface.py --lattice_size ${lattice_size} --bond_dim ${bond_dim} --error_rate ${error_rate} --bias_prob ${bias_prob} --num_experiments ${num_experiments} --error_model "${error_model}" --seed ${seed} --num_processes ${num_processes} | ||
EOS | ||
echo "Submitting the job for lattice size ${lattice_size}, bond dimension ${bond_dim}, error rate ${error_rate}, error model ${error_model}, and seed ${seed}." | ||
echo "Submitting the job for lattice size ${lattice_size}, bond dimension ${bond_dim}, error rate ${error_rate}, error model ${error_model}, bias probability ${bias_prob} and seed ${seed}." | ||
sbatch "$job_script" | ||
rm "$job_script" | ||
done | ||
|