Skip to content

Commit

Permalink
Merge pull request #8 from yyq2020/main
Browse files Browse the repository at this point in the history
Code of BB84 protocol post-processing
  • Loading branch information
ertuil committed Nov 15, 2023
2 parents 3902842 + 560118e commit f6ccce6
Show file tree
Hide file tree
Showing 8 changed files with 608 additions and 19 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/pytest_python39.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This is a basic workflow to help you get started with Actions

name: Pytest_3.9

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
cache: 'pip'

# Runs a set of commands using the runners shell
- name: Setup packets
run: |
pip3 install -r requirements.txt
python setup.py develop
- name: Run tests
run: python3 -m pytest
8 changes: 4 additions & 4 deletions qns/models/qubit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from qns.models.qubit.qubit import Qubit, QState
from qns.models.qubit.gate import X, Y, Z, H, S, T, R, I, CNOT, joint,\
from qns.models.qubit.gate import X, Y, Z, H, S, T, R, I, CNOT, joint, \
RX, RY, RZ, U, CZ, CR, CX, CY, ControlledGate, Swap, Toffoli
from qns.models.qubit.utils import single_gate_expand
from qns.models.qubit.decoherence import PrefectMeasureErrorModel, PrefectOperateErrorModel,\
PrefectStorageErrorModel, PrefectTransferErrorModel, DephaseMeasureErrorModel,\
DephaseOperateErrorModel, DephaseStorageErrorModel, DephaseTransferErrorModel,\
from qns.models.qubit.decoherence import PrefectMeasureErrorModel, PrefectOperateErrorModel, \
PrefectStorageErrorModel, PrefectTransferErrorModel, DephaseMeasureErrorModel, \
DephaseOperateErrorModel, DephaseStorageErrorModel, DephaseTransferErrorModel, \
DepolarMeasureErrorModel, DepolarOperateErrorModel, DepolarStorageErrorModel, DepolarTransferErrorModel
from qns.models.qubit.factory import QubitFactory

Expand Down
2 changes: 1 addition & 1 deletion qns/models/qubit/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from typing import Optional
import numpy as np
from qns.models.qubit.const import QUBIT_STATE_0
from qns.models.qubit.decoherence import PrefectMeasureErrorModel, PrefectOperateErrorModel, PrefectStorageErrorModel,\
from qns.models.qubit.decoherence import PrefectMeasureErrorModel, PrefectOperateErrorModel, PrefectStorageErrorModel, \
PrefectTransferErrorModel
from qns.models.qubit.qubit import Qubit

Expand Down
6 changes: 3 additions & 3 deletions qns/models/qubit/gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

from typing import Any, Optional
import numpy as np
from qns.models.qubit.const import OPERATOR_HADAMARD, OPERATOR_PAULI_I,\
from qns.models.qubit.const import OPERATOR_HADAMARD, OPERATOR_PAULI_I, \
OPERATOR_PAULI_X, OPERATOR_PAULI_Y, \
OPERATOR_PAULI_Z, OPERATOR_PHASE_SHIFT,\
OPERATOR_RX, OPERATOR_RY, OPERATOR_RZ,\
OPERATOR_PAULI_Z, OPERATOR_PHASE_SHIFT, \
OPERATOR_RX, OPERATOR_RY, OPERATOR_RZ, \
OPERATOR_S, OPERATOR_T
from qns.models.qubit.qubit import Qubit
from qns.models.qubit.utils import kron, joint
Expand Down
4 changes: 2 additions & 2 deletions qns/models/qubit/qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
from typing import Any, List, Optional
import numpy as np

from qns.models.qubit.const import QUBIT_STATE_0, QUBIT_STATE_1,\
from qns.models.qubit.const import QUBIT_STATE_0, QUBIT_STATE_1, \
QUBIT_STATE_P, QUBIT_STATE_N, QUBIT_STATE_L, QUBIT_STATE_R
from qns.models.qubit.utils import single_gate_expand, partial_trace, kron
from qns.models.core.backend import QuantumModel
from qns.models.qubit.errors import QStateBaseError, QStateQubitNotInStateError,\
from qns.models.qubit.errors import QStateBaseError, QStateQubitNotInStateError, \
QStateSizeNotMatchError, OperatorNotMatchError
from qns.utils.rnd import get_rand

Expand Down
2 changes: 1 addition & 1 deletion qns/network/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from qns.network.network import QuantumNetwork, QNSNetworkError
from qns.network.requests import Request
from qns.network.topology import Topology, LineTopology, RandomTopology,\
from qns.network.topology import Topology, LineTopology, RandomTopology, \
GridTopology, TreeTopology, BasicTopology, WaxmanTopology
from qns.network.route.route import RouteImpl, NetworkRouteError
from qns.network.route.dijkstra import DijkstraRouteAlgorithm
Expand Down
Loading

0 comments on commit f6ccce6

Please sign in to comment.