From 447d26bcba72fb7d24c65892913dca420378037c Mon Sep 17 00:00:00 2001 From: Didictateur Date: Sat, 14 Oct 2023 23:12:14 +0200 Subject: [PATCH] true version --- LICENSE | 21 --------------------- {src/QElephant => QElephant}/Matrix.py | 0 {src/QElephant => QElephant}/QuBit.py | 22 +++++++++++----------- {src/QElephant => QElephant}/__init__.py | 0 pyproject.toml | 16 ---------------- setup.py | 11 +++++++++++ 6 files changed, 22 insertions(+), 48 deletions(-) delete mode 100644 LICENSE rename {src/QElephant => QElephant}/Matrix.py (100%) rename {src/QElephant => QElephant}/QuBit.py (92%) rename {src/QElephant => QElephant}/__init__.py (100%) delete mode 100644 pyproject.toml create mode 100644 setup.py diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 63b4b68..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) [year] [fullname] - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/src/QElephant/Matrix.py b/QElephant/Matrix.py similarity index 100% rename from src/QElephant/Matrix.py rename to QElephant/Matrix.py diff --git a/src/QElephant/QuBit.py b/QElephant/QuBit.py similarity index 92% rename from src/QElephant/QuBit.py rename to QElephant/QuBit.py index f7f6b18..6a8e077 100644 --- a/src/QElephant/QuBit.py +++ b/QElephant/QuBit.py @@ -1,7 +1,7 @@ import math import random as rd -from Matrix import * +from QElephant.Matrix import * I = complex(0, 1) @@ -118,61 +118,61 @@ class IQuBit: def H(q: (QuBit | IQuBit)) -> None: if type(q) == QuBit: - q._Qubit__apply(Matrix.H()) + q._QuBit__apply(Matrix.H()) elif type(q) == IQuBit: q._IQuBit__apply(Matrix.H()) def X(q: (QuBit | IQuBit)) -> None: if type(q) == QuBit: - q._Qubit__apply(Matrix.X()) + q._QuBit__apply(Matrix.X()) elif type(q) == IQuBit: q._IQuBit__apply(Matrix.X()) def Y(q: (QuBit | IQuBit)) -> None: if type(q) == QuBit: - q._Qubit__apply(Matrix.Y()) + q._QuBit__apply(Matrix.Y()) elif type(q) == IQuBit: q._IQuBit__apply(Matrix.Y()) def Z(q: (QuBit | IQuBit)) -> None: if type(q) == QuBit: - q._Qubit__apply(Matrix.Z()) + q._QuBit__apply(Matrix.Z()) elif type(q) == IQuBit: q._IQuBit__apply(Matrix.Z()) def S(q: (QuBit | IQuBit)) -> None: if type(q) == QuBit: - q._Qubit__apply(Matrix.S()) + q._QuBit__apply(Matrix.S()) elif type(q) == IQuBit: q._IQuBit__apply(Matrix.S()) def T(q: (QuBit | IQuBit)) -> None: if type(q) == QuBit: - q._Qubit__apply(Matrix.T()) + q._QuBit__apply(Matrix.T()) elif type(q) == IQuBit: q._IQuBit__apply(Matrix.T()) def Rx(q: (QuBit | IQuBit), phi: float) -> None: if type(q) == QuBit: - q._Qubit__apply(Matrix.Rx(phi)) + q._QuBit__apply(Matrix.Rx(phi)) elif type(q) == IQuBit: q._IQuBit__apply(Matrix.Rx(phi)) def Ry(q: (QuBit | IQuBit), phi: float) -> None: if type(q) == QuBit: - q._Qubit__apply(Matrix.Ry(phi)) + q._QuBit__apply(Matrix.Ry(phi)) elif type(q) == IQuBit: q._IQuBit__apply(Matrix.Ry(phi)) def Rz(q: (QuBit | IQuBit), phi: float) -> None: if type(q) == QuBit: - q._Qubit__apply(Matrix.Rz(phi)) + q._QuBit__apply(Matrix.Rz(phi)) elif type(q) == IQuBit: q._IQuBit__apply(Matrix.Rz(phi)) def R1(q: (QuBit | IQuBit), phi: float) -> None: if type(q) == QuBit: - q._Qubit__apply(Matrix.R1(phi)) + q._QuBit__apply(Matrix.R1(phi)) elif type(q) == IQuBit: q._IQuBit__apply(Matrix.R1(phi)) diff --git a/src/QElephant/__init__.py b/QElephant/__init__.py similarity index 100% rename from src/QElephant/__init__.py rename to QElephant/__init__.py diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 6cf4c1e..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,16 +0,0 @@ -require = ["hatchling", "math", "random"] -build-backend = "hatchling.build" - -name = "QElephant" -version = "0.0.1" -authors = [ - { name = "Didictateur"} -] -description = "" -readme = "README.me" -requires-python = ">= 3.0" -classifiers = [ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", -] \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d672a3f --- /dev/null +++ b/setup.py @@ -0,0 +1,11 @@ +from setuptools import setup + +setup( + name="QElephant", + version="1.0.2", + description="", + author="Didictateur", + author_email="decosse.adrien@gmail.com", + packages=["QElephant"], + install_requires=[], +)