qns.models.epr package

Submodules

qns.models.epr.bell module

class qns.models.epr.bell.BellStateEntanglement(fidelity: float = 1, name: Optional[str] = None, p_swap: float = 1)[source]

Bases: qns.models.epr.entanglement.BaseEntanglement, qns.models.core.backend.QuantumModel

BellStateEntanglement is the ideal max entangled qubits. Its fidelity is always 1.

distillation(epr: qns.models.epr.bell.BellStateEntanglement)[source]

Use self and epr to perfrom distillation and distribute a new entanglement

Parameters

epr (BaseEntanglement) – another entanglement

Returns

the new distributed entanglement

store_error_model(t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for storing this entangled pair in a quantum memory. The default behavior is doing nothing

Parameters
  • t – the time stored in a quantum memory. The unit it second.

  • decoherence_rate (float) – the decoherence_rate

  • kwargs – other parameters

swapping(epr: qns.models.epr.bell.BellStateEntanglement)[source]

Use self and epr to perfrom swapping and distribute a new entanglement

Parameters

epr (BaseEntanglement) – another entanglement

Returns

the new distributed entanglement

transfer_error_model(length: float, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for transmitting this entanglement. The default behavior is doing nothing

Parameters
  • length (float) – the length of the channel

  • decoherence_rate (float) – the decoherency rate

  • kwargs – other parameters

qns.models.epr.entanglement module

class qns.models.epr.entanglement.BaseEntanglement(fidelity: float = 1, name: Optional[str] = None)[source]

Bases: object

This is the base entanglement model

distillation(epr: qns.models.epr.entanglement.BaseEntanglement) qns.models.epr.entanglement.BaseEntanglement[source]

Use self and epr to perfrom distillation and distribute a new entanglement

Parameters

epr (BaseEntanglement) – another entanglement

Returns

the new distributed entanglement

swapping(epr: qns.models.epr.entanglement.BaseEntanglement) qns.models.epr.entanglement.BaseEntanglement[source]

Use self and epr to perfrom swapping and distribute a new entanglement

Parameters

epr (BaseEntanglement) – another entanglement

Returns

the new distributed entanglement

teleportion(qubit: qns.models.qubit.qubit.Qubit) qns.models.qubit.qubit.Qubit[source]

Use self and epr to perfrom distillation and distribute a new entanglement

Parameters

epr (BaseEntanglement) – another entanglement

Returns

the new distributed entanglement

to_qubits() List[qns.models.qubit.qubit.Qubit][source]

Transport the entanglement into a pair of qubits based on the fidelity. Suppose the first qubit is [1/sqrt(2), 1/sqrt(2)].H

Returns

A list of two qubits

qns.models.epr.mixed module

class qns.models.epr.mixed.MixedStateEntanglement(fidelity: float = 1, b: Optional[float] = None, c: Optional[float] = None, d: Optional[float] = None, name: Optional[str] = None)[source]

Bases: qns.models.epr.entanglement.BaseEntanglement, qns.models.core.backend.QuantumModel

MixedStateEntanglement is a pair of entangled qubits in mixed State with a hidden-variable. rho = A * Phi^+ + B * Psi^+ + C * Psi^- + D * Phi^-

property a: float

a equals to the fidelity

distillation(epr: qns.models.epr.mixed.MixedStateEntanglement, name: Optional[str] = None)[source]

Use self and epr to perfrom distillation and distribute a new entanglement. Using BBPSSW protocol.

Parameters
  • epr (BaseEntanglement) – another entanglement

  • name (str) – the name of the new entanglement

Returns

the new distributed entanglement

normalized()[source]
store_error_model(t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for storing this entangled pair in a quantum memory. The default behavior is:

a = 0.25 + (a-0.25)*e^{decoherence_rate*t} b = 0.25 + (b-0.25)*e^{decoherence_rate*t} c = 0.25 + (c-0.25)*e^{decoherence_rate*t} d = 0.25 + (d-0.25)*e^{decoherence_rate*t}

Parameters
  • t – the time stored in a quantum memory. The unit it second.

  • decoherence_rate – the decoherence rate, equals to 1/T_coh, where T_coh is the coherence time.

  • kwargs – other parameters

swapping(epr: qns.models.epr.mixed.MixedStateEntanglement, name: Optional[str] = None)[source]

Use self and epr to perfrom swapping and distribute a new entanglement

Parameters
  • epr (MixedEntanglement) – another entanglement

  • name (str) – the name of the new entanglement

Returns

the new distributed entanglement

to_qubits() List[qns.models.qubit.qubit.Qubit][source]

Transport the entanglement into a pair of qubits based on the fidelity. Suppose the first qubit is [1/sqrt(2), 1/sqrt(2)].H

Returns

A list of two qubits

transfer_error_model(length: float, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for transmitting this entanglement. The success possibility of transmitting is:

a = 0.25 + (a-0.25)*e^{decoherence_rate*length} b = 0.25 + (b-0.25)*e^{decoherence_rate*length} c = 0.25 + (c-0.25)*e^{decoherence_rate*length} d = 0.25 + (d-0.25)*e^{decoherence_rate*length}

Parameters
  • length (float) – the length of the channel

  • decoherence_rate (float) – the decoherency rate

  • kwargs – other parameters

qns.models.epr.werner module

class qns.models.epr.werner.WernerStateEntanglement(fidelity: float = 1, name: Optional[str] = None)[source]

Bases: qns.models.epr.entanglement.BaseEntanglement, qns.models.core.backend.QuantumModel

WernerStateEntanglement is a pair of entangled qubits in Werner State with a hidden-variable.

distillation(epr: qns.models.epr.werner.WernerStateEntanglement, name: Optional[str] = None)[source]

Use self and epr to perfrom distillation and distribute a new entanglement. Using Bennett 96 protocol and estimate lower bound.

Parameters
  • epr (WernerEntanglement) – another entanglement

  • name (str) – the name of the new entanglement

Returns

the new distributed entanglement

property fidelity: float
store_error_model(t: float, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for storing this entangled pair in a quantum memory. The default behavior is: w = w*e^{-decoherence_rate*t}, default a = 0

Parameters
  • t – the time stored in a quantum memory. The unit it second.

  • decoherence_rate – the decoherence rate, equals to 1/T_coh, where T_coh is the coherence time.

  • kwargs – other parameters

swapping(epr: qns.models.epr.werner.WernerStateEntanglement, name: Optional[str] = None)[source]

Use self and epr to perfrom swapping and distribute a new entanglement

Parameters
  • epr (WernerEntanglement) – another entanglement

  • name (str) – the name of the new entanglement

Returns

the new distributed entanglement

to_qubits() List[qns.models.qubit.qubit.Qubit][source]

Transport the entanglement into a pair of qubits based on the fidelity. Suppose the first qubit is [1/sqrt(2), 1/sqrt(2)].H

Returns

A list of two qubits

transfer_error_model(length: float, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for transmitting this entanglement. The success possibility of transmitting is: w = w* e^{decoherence_rate * length}

Parameters
  • length (float) – the length of the channel

  • kwargs – other parameters

Module contents

class qns.models.epr.BaseEntanglement(fidelity: float = 1, name: Optional[str] = None)[source]

Bases: object

This is the base entanglement model

distillation(epr: qns.models.epr.entanglement.BaseEntanglement) qns.models.epr.entanglement.BaseEntanglement[source]

Use self and epr to perfrom distillation and distribute a new entanglement

Parameters

epr (BaseEntanglement) – another entanglement

Returns

the new distributed entanglement

swapping(epr: qns.models.epr.entanglement.BaseEntanglement) qns.models.epr.entanglement.BaseEntanglement[source]

Use self and epr to perfrom swapping and distribute a new entanglement

Parameters

epr (BaseEntanglement) – another entanglement

Returns

the new distributed entanglement

teleportion(qubit: qns.models.qubit.qubit.Qubit) qns.models.qubit.qubit.Qubit[source]

Use self and epr to perfrom distillation and distribute a new entanglement

Parameters

epr (BaseEntanglement) – another entanglement

Returns

the new distributed entanglement

to_qubits() List[qns.models.qubit.qubit.Qubit][source]

Transport the entanglement into a pair of qubits based on the fidelity. Suppose the first qubit is [1/sqrt(2), 1/sqrt(2)].H

Returns

A list of two qubits

class qns.models.epr.BellStateEntanglement(fidelity: float = 1, name: Optional[str] = None, p_swap: float = 1)[source]

Bases: qns.models.epr.entanglement.BaseEntanglement, qns.models.core.backend.QuantumModel

BellStateEntanglement is the ideal max entangled qubits. Its fidelity is always 1.

distillation(epr: qns.models.epr.bell.BellStateEntanglement)[source]

Use self and epr to perfrom distillation and distribute a new entanglement

Parameters

epr (BaseEntanglement) – another entanglement

Returns

the new distributed entanglement

store_error_model(t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for storing this entangled pair in a quantum memory. The default behavior is doing nothing

Parameters
  • t – the time stored in a quantum memory. The unit it second.

  • decoherence_rate (float) – the decoherence_rate

  • kwargs – other parameters

swapping(epr: qns.models.epr.bell.BellStateEntanglement)[source]

Use self and epr to perfrom swapping and distribute a new entanglement

Parameters

epr (BaseEntanglement) – another entanglement

Returns

the new distributed entanglement

transfer_error_model(length: float, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for transmitting this entanglement. The default behavior is doing nothing

Parameters
  • length (float) – the length of the channel

  • decoherence_rate (float) – the decoherency rate

  • kwargs – other parameters

class qns.models.epr.MixedStateEntanglement(fidelity: float = 1, b: Optional[float] = None, c: Optional[float] = None, d: Optional[float] = None, name: Optional[str] = None)[source]

Bases: qns.models.epr.entanglement.BaseEntanglement, qns.models.core.backend.QuantumModel

MixedStateEntanglement is a pair of entangled qubits in mixed State with a hidden-variable. rho = A * Phi^+ + B * Psi^+ + C * Psi^- + D * Phi^-

property a: float

a equals to the fidelity

distillation(epr: qns.models.epr.mixed.MixedStateEntanglement, name: Optional[str] = None)[source]

Use self and epr to perfrom distillation and distribute a new entanglement. Using BBPSSW protocol.

Parameters
  • epr (BaseEntanglement) – another entanglement

  • name (str) – the name of the new entanglement

Returns

the new distributed entanglement

normalized()[source]
store_error_model(t: Optional[float] = 0, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for storing this entangled pair in a quantum memory. The default behavior is:

a = 0.25 + (a-0.25)*e^{decoherence_rate*t} b = 0.25 + (b-0.25)*e^{decoherence_rate*t} c = 0.25 + (c-0.25)*e^{decoherence_rate*t} d = 0.25 + (d-0.25)*e^{decoherence_rate*t}

Parameters
  • t – the time stored in a quantum memory. The unit it second.

  • decoherence_rate – the decoherence rate, equals to 1/T_coh, where T_coh is the coherence time.

  • kwargs – other parameters

swapping(epr: qns.models.epr.mixed.MixedStateEntanglement, name: Optional[str] = None)[source]

Use self and epr to perfrom swapping and distribute a new entanglement

Parameters
  • epr (MixedEntanglement) – another entanglement

  • name (str) – the name of the new entanglement

Returns

the new distributed entanglement

to_qubits() List[qns.models.qubit.qubit.Qubit][source]

Transport the entanglement into a pair of qubits based on the fidelity. Suppose the first qubit is [1/sqrt(2), 1/sqrt(2)].H

Returns

A list of two qubits

transfer_error_model(length: float, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for transmitting this entanglement. The success possibility of transmitting is:

a = 0.25 + (a-0.25)*e^{decoherence_rate*length} b = 0.25 + (b-0.25)*e^{decoherence_rate*length} c = 0.25 + (c-0.25)*e^{decoherence_rate*length} d = 0.25 + (d-0.25)*e^{decoherence_rate*length}

Parameters
  • length (float) – the length of the channel

  • decoherence_rate (float) – the decoherency rate

  • kwargs – other parameters

class qns.models.epr.WernerStateEntanglement(fidelity: float = 1, name: Optional[str] = None)[source]

Bases: qns.models.epr.entanglement.BaseEntanglement, qns.models.core.backend.QuantumModel

WernerStateEntanglement is a pair of entangled qubits in Werner State with a hidden-variable.

distillation(epr: qns.models.epr.werner.WernerStateEntanglement, name: Optional[str] = None)[source]

Use self and epr to perfrom distillation and distribute a new entanglement. Using Bennett 96 protocol and estimate lower bound.

Parameters
  • epr (WernerEntanglement) – another entanglement

  • name (str) – the name of the new entanglement

Returns

the new distributed entanglement

property fidelity: float
store_error_model(t: float, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for storing this entangled pair in a quantum memory. The default behavior is: w = w*e^{-decoherence_rate*t}, default a = 0

Parameters
  • t – the time stored in a quantum memory. The unit it second.

  • decoherence_rate – the decoherence rate, equals to 1/T_coh, where T_coh is the coherence time.

  • kwargs – other parameters

swapping(epr: qns.models.epr.werner.WernerStateEntanglement, name: Optional[str] = None)[source]

Use self and epr to perfrom swapping and distribute a new entanglement

Parameters
  • epr (WernerEntanglement) – another entanglement

  • name (str) – the name of the new entanglement

Returns

the new distributed entanglement

to_qubits() List[qns.models.qubit.qubit.Qubit][source]

Transport the entanglement into a pair of qubits based on the fidelity. Suppose the first qubit is [1/sqrt(2), 1/sqrt(2)].H

Returns

A list of two qubits

transfer_error_model(length: float, decoherence_rate: Optional[float] = 0, **kwargs)[source]

The default error model for transmitting this entanglement. The success possibility of transmitting is: w = w* e^{decoherence_rate * length}

Parameters
  • length (float) – the length of the channel

  • kwargs – other parameters