Skip to content

Commit

Permalink
update exp-1 and batch simulation file
Browse files Browse the repository at this point in the history
  • Loading branch information
Naphann committed Jul 27, 2024
1 parent 6b093c8 commit de845fd
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 46 deletions.
64 changes: 45 additions & 19 deletions quisp/batch-simulation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,40 @@

pids=()

# for i in 1 2 4 8 16 32 64;
# do
# echo "Running first exp with $i memories"
# ./quisp -n "./networks:./channels:./modules:./simulations" \
# -i ./images./simulations/mim_generation_test.ini -u Cmdenv \
# -c "memory_$i" --cmdenv-status-frequency=10s > "out-$i" &
# pids += ($ !)
# done
for i in 1 2 4 8 16 32 64;
do
echo "Running first exp with $i memories"
./quisp -n "./networks:./channels:./modules:./simulations" \
-i ./images ./simulations/mim_generation_test.ini -u Cmdenv \
-c "memory_$i" --cmdenv-status-frequency=10s > "exp1-raw-memories-$i" &
pids+=($!)
done
# wait for all pids
echo "waiting for first experiments"
for pid in ${pids[*]};
do
echo "waiting on pid = $pid"
wait $pid
done
pids=()

# for i in 0 1 2 3 4 5 6 7 8 9 10;
# do
# alicedist = "$((20 - $i))"
# echo "Running imbalanced BSA placement with distance $i - $alicedist"
# ./quisp -n "./networks:./channels:./modules:./simulations" \
# -i ./images./simulations/cross_validation.ini -u Cmdenv \
# -c "mim_imbalanced_${alicedist}_${i}" --cmdenv-status-frequency=10s > "exp2-raw-${alicedist}_${i}" &
# pids += ($ !)
# done
for i in 0 1 2 3 4 5 6 7 8 9 10;
do
alicedist = "$((20 - $i))"
echo "Running imbalanced BSA placement with distance $i - $alicedist"
./quisp -n "./networks:./channels:./modules:./simulations" \
-i ./images ./simulations/cross_validation.ini -u Cmdenv \
-c "mim_imbalanced_${alicedist}_${i}" --cmdenv-status-frequency=10s > "exp2-raw-${alicedist}_${i}" &
pids += ($ !)
done
wait for all pids
echo "waiting for second experiments"
for pid in ${pids[*]};
do
echo "waiting on pid = $pid"
wait $pid
done
pids=()

for cnot in 0 025 05 075 1 125 15 175 2 225 25 275 3 325 35 375 4 425 45 475 5;
do
Expand All @@ -37,6 +53,14 @@ do
--cmdenv-status-frequency=10s > "exp3-raw-${cnot}_0_without_decoherence" &
pids+=($!)
done
# wait for all pids
echo "waiting for third experiments (CNOT error)"
for pid in ${pids[*]};
do
echo "waiting on pid = $pid"
wait $pid
done
pids=()

for meas in 025 05 075 1 125 15 175 2 225 25 275 3 325 35 375 4 425 45 475 5;
do
Expand All @@ -54,11 +78,13 @@ do
--cmdenv-status-frequency=10s > "exp3-raw-0_${meas}_without_decoherence" &
pids+=($!)
done

# wait for all pids
echo "waiting for third experiments (measurement error)"
for pid in ${pids[*]};
do
echo "waiting on pid = $pid"
wait $pid done
wait $pid
done
pids=()

echo "All simulations finished"
8 changes: 4 additions & 4 deletions quisp/networks/cross_validation_network.ned
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ network cross_validation_mim_link_middle
@display("i=COMP");
}
connections:
alice.port++ <--> ClassicalChannel { distance = 20km; } <--> BSA.port++;
BSA.port++ <--> ClassicalChannel { distance = 20km; } <--> bob.port++;
alice.quantum_port++ <--> QuantumChannel { distance = 20km; } <--> BSA.quantum_port++;
BSA.quantum_port++ <--> QuantumChannel { distance = 20km; } <--> bob.quantum_port++;
alice.port++ <--> ClassicalChannel { distance = 10km; } <--> BSA.port++;
BSA.port++ <--> ClassicalChannel { distance = 10km; } <--> bob.port++;
alice.quantum_port++ <--> QuantumChannel { distance = 10km; } <--> BSA.quantum_port++;
BSA.quantum_port++ <--> QuantumChannel { distance = 10km; } <--> bob.quantum_port++;
}

network cross_validation_mim_link_imbalanced_10_10
Expand Down
2 changes: 1 addition & 1 deletion quisp/post-process-simulation-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
for i in 1 2 4 8 16 32 64;
do
# sed command to print even numbered lines
grep "sim time" "out-$i" | awk '{print $3}' | sed -n 'n;p' > "postprocess-memory-$i"
grep "sim time" "exp1-raw-memories-$i" | awk '{print $3}' | sed -n 'n;p' > "postprocess-exp1-memories-$i"
done

for i in 0 1 2 3 4 5 6 7 8 9 10;
Expand Down
25 changes: 3 additions & 22 deletions quisp/simulations/cross_validation_config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,7 @@
def generate_mim_exp_config(num_memories: int, alice_to_bsa: int, bob_to_bsa: int):
# [Config mim_imbalanced_10_10]
# network = networks.cross_validation_mim_link_imbalanced_10_10
# **.qrsa.hm.link_tomography = true
# **.qrsa.hm.initial_purification = 0
# **.qrsa.hm.purification_type = ""
# **.buffers = 1
pass
# config_name = f"[Config swapping_validation_cnot_only_{cnot_error_prob}]"
# network_name = f"networks.cross_validation_swapping"
# error_params = [
# f"**.cnot_gate_error_rate = {cnot_error_prob}",
# f"**.cnot_gate_iz_error_ratio = {1/9}",
# f"**.cnot_gate_zi_error_ratio = {1/9}",
# f"**.cnot_gate_zz_error_ratio = {1/9}",
# f"**.cnot_gate_ix_error_ratio = {1/9}",
# f"**.cnot_gate_xi_error_ratio = {1/9}",
# f"**.cnot_gate_xx_error_ratio = {1/9}",
# f"**.cnot_gate_iy_error_ratio = {1/9}",
# f"**.cnot_gate_yi_error_ratio = {1/9}",
# f"**.cnot_gate_yy_error_ratio = {1/9}",
# ]
# return [config_name, network_name, *error_params]


def generate_swapping_config(cnot_error_prob: float, measurement_error_prob: float, with_depolarizing: bool):
Expand Down Expand Up @@ -61,9 +42,9 @@ def generate_swapping_config(cnot_error_prob: float, measurement_error_prob: flo
error_params = [
f"**.cnot_gate_error_rate = {cnot_error_prob}",
#
f"**.x_measurement_error_rate = {measurement_error_prob}",
f"**.y_measurement_error_rate = {measurement_error_prob}",
f"**.z_measurement_error_rate = {measurement_error_prob}",
f"*.Repeater.x_measurement_error_rate = {measurement_error_prob}",
f"*.Repeater.y_measurement_error_rate = {measurement_error_prob}",
f"*.Repeater.z_measurement_error_rate = {measurement_error_prob}",
#
f"**.memory_x_error_rate = {p_decoherence}",
f"**.memory_y_error_rate = {p_decoherence}",
Expand Down

0 comments on commit de845fd

Please sign in to comment.