You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm performing an entanglement swap using 4 qubits in Qiskit. I make my own noisy gates and insert noise in the circuit. I want to create two noisy input Bell pairs of various two different fidelities and, after performing the swap, find the fidelity of the swapped circuit. I'm using a depolarizing error for the CNOT gates and CZ gates. The problem arises when I make the measurement and calculate the fidelity using the Hellinger Fidelity function in Qiskit. For the lower value of two input fidelities, the outcome fidelity is higher than the two input fidelities. How is that possible?
It seems like the there is an inherent problem in the depolarizing channel, for lower values ~0,4 - 0.5. The output fidelities are always higher when f1 and f2 values are selected within the range of ~0.4 - 0.5
How can we reproduce the issue?
defentanglement_swap(f1, f2, dep_errorx, dep_errorz):
"""Simulate entanglement swapping with depolarizing errors and given initial fidelities. Args: f1 (float): Fidelity of the first Bell pair. f2 (float): Fidelity of the second Bell pair. dep_error (float): Depolarizing error rate for CNOT gates. Returns: float: Estimated fidelity after entanglement swapping. """# Calculate depolarizing error rates from the given fidelities f1 and f2p1= (4/3) *(1- (f1))
p2= (4/3) *(1- (f2))
#prepare the noisy gates cx_gate=CXGate() # regular cnot gateh_gate=HGate() # regular H gatecz_gate=CZGate()
cx1_gate=CXGate(label="cx1") # first labelled CX gate cx2_gate=CXGate(label="cx2") # second labelled CX gatecx3_gate=CXGate(label="cx3") # third labelled CX gate cx4_gate=CXGate(label="cx4") # fourth labelled CX gate cz1_gate=CZGate(label="cz1")
# create the depolarizing errors for each CX gatecx1_error=depolarizing_error(p1, 2) # For the first Bell paircx2_error=depolarizing_error(p2, 2) # For the second Bell paircx3_error=depolarizing_error(dep_errorx, 2)
cx4_error=depolarizing_error(dep_errorx, 2)
cz_error=depolarizing_error(dep_errorz, 2)
#readout error only if we perform any sort of measurement#ro_err_rate = 0.1#ro_err = ReadoutError( [[1 - ro_err_rate, ro_err_rate], [ro_err_rate, 1 - ro_err_rate]] )#jot down the noise modelnoise_model_gate=NoiseModel()
noise_model_gate.add_all_qubit_quantum_error(cx1_error, cx1_gate.label)
noise_model_gate.add_all_qubit_quantum_error(cx2_error, cx2_gate.label)
noise_model_gate.add_all_qubit_quantum_error(cx3_error, cx3_gate.label)
noise_model_gate.add_all_qubit_quantum_error(cx4_error, cx4_gate.label)
noise_model_gate.add_all_qubit_quantum_error(cz_error, cz1_gate.label)
# noise_model_gate.add_readout_error(ro_err, [0])noise_model_gate.add_basis_gates(['cx','cz1', 'cx1','cx2','cx3','cx4']) #adds noise to basis gates# make the quantum circuit with noise gatesbell_noise=QuantumCircuit(4, 2)
#make the first bell pairbell_noise.h(0)
bell_noise.append(cx1_gate, [0,1]) # first noisy cx gate#make the second bell pairbell_noise.h(2)
bell_noise.append(cx2_gate, [2,3]) # second noisy cx gatebell_noise.append(cx3_gate, [1,2]) # swap noisy cx gate#bell_noise.cx(1,2)bell_noise.h(1)
bell_noise.barrier()
bell_noise.append(cz1_gate, [0,1])
#bell_noise.cz(0,1)#bell_noise.cx(2,3)bell_noise.append(cx4_gate, [2,3])
bell_noise.barrier()
bell_noise.measure([0,3],[0,1])
# Simulate the circuit with the noise modelbasis_gates=noise_model_gate.basis_gatessim_noise=AerSimulator(noise_model=noise_model_gate, basis_gates=basis_gates)
rep=2000qc_aer=transpile(bell_noise, backend=sim_noise)
result=sim_noise.run(qc_aer, shots=rep).result()
counts=result.get_counts()
# Estimate fidelity (assuming ideal Bell state |Φ+⟩ = (|00⟩ + |11⟩)/√2)#fidelity = correct_outcomes / repreturncountsf1=0.4f2=0.4dep_errorx=0dep_errorz=0noise_counts=entanglement_swap(f1, f2, dep_errorx, dep_errorz) # , dep_errorx, dep_errorz)#use Hellinger fidelity for ideal and noise count dictfidelity=hellinger_fidelity(counts_ideal, noise_counts)
print("Fidelity of entanglement swap F_AC=", fidelity)
Fidelity of entanglement swap F_AC= 0.5224602685141051
What should happen?
The fidelity of the total output of the swapped circuit has to be less than the input fidelities of the bell pair.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered:
Environment
What is happening?
I'm performing an entanglement swap using 4 qubits in Qiskit. I make my own noisy gates and insert noise in the circuit. I want to create two noisy input Bell pairs of various two different fidelities and, after performing the swap, find the fidelity of the swapped circuit. I'm using a depolarizing error for the CNOT gates and CZ gates. The problem arises when I make the measurement and calculate the fidelity using the Hellinger Fidelity function in Qiskit. For the lower value of two input fidelities, the outcome fidelity is higher than the two input fidelities. How is that possible?
It seems like the there is an inherent problem in the depolarizing channel, for lower values ~0,4 - 0.5. The output fidelities are always higher when f1 and f2 values are selected within the range of ~0.4 - 0.5
How can we reproduce the issue?
Fidelity of entanglement swap F_AC= 0.5224602685141051
What should happen?
The fidelity of the total output of the swapped circuit has to be less than the input fidelities of the bell pair.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: