Skip to content
This repository was archived by the owner on May 28, 2024. It is now read-only.

Commit eabc3c8

Browse files
committed
processor
1 parent 24d34b2 commit eabc3c8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Main/processor.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import netsquid as ns
2+
import netsquid.components.instructions as instr
3+
import netsquid.qubits.ketstates as ks
4+
from netsquid.components import ClassicalChannel
5+
from netsquid.components import PhysicalInstruction, QuantumProcessor, DepolarNoiseModel, DephaseNoiseModel
6+
7+
from netsquid.qubits import
8+
9+
def create_processor(depolar_rate, dephase_rate):
10+
measure_noise_model = DephaseNoiseModel(dephase_rate=dephase_rate,
11+
time_independent=True)
12+
physical_instructions = [
13+
PhysicalInstruction(instr.INSTR_INIT, duration=3, parallel=True),
14+
PhysicalInstruction(instr.INSTR_H, duration=1, parallel=True),
15+
PhysicalInstruction(instr.INSTR_X, duration=1, parallel=True),
16+
PhysicalInstruction(instr.INSTR_Z, duration=1, parallel=True),
17+
PhysicalInstruction(instr.INSTR_S, duration=1, parallel=True),
18+
PhysicalInstruction(instr.INSTR_CNOT, duration=4, parallel=True),
19+
PhysicalInstruction(instr.INSTR_MEASURE,
20+
duration=7,
21+
parallel=False,
22+
quantum_noise_model=measure_noise_model,
23+
apply_q_noise_after=False)
24+
]
25+
memory_noise_model = DepolarNoiseModel(depolar_rate=depolar_rate)
26+
27+
processor = QuantumProcessor("quantum_processor",
28+
num_positions=1,
29+
memory_noise_models=[memory_noise_model],
30+
phys_instructions=physical_instructions)
31+
return processor

0 commit comments

Comments
 (0)