holobit-sdk 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include requirements.txt
3
+ include LICENSE
4
+ recursive-include docs *
5
+ recursive-include examples *
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.2
2
+ Name: holobit-sdk
3
+ Version: 1.0.0
4
+ Summary: SDK para la transpilación y ejecución de código holográfico cuántico.
5
+ Home-page: https://github.com/Alphonsus411/holobit_SDK
6
+ Author: Tu Nombre
7
+ Author-email: Adolfo González Hernández <adolfogonzal@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2024
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
30
+ Project-URL: Homepage, https://github.com/Alphonsus411/holobit_SDK
31
+ Project-URL: Bug Tracker, https://github.com/Alphonsus411/holobit_SDK/issues
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Operating System :: OS Independent
35
+ Requires-Python: >=3.10
36
+ Description-Content-Type: text/markdown
37
+ License-File: LICENSE
38
+ Requires-Dist: setuptools
39
+ Requires-Dist: wheel
40
+ Requires-Dist: twine
41
+ Dynamic: author
42
+ Dynamic: home-page
43
+ Dynamic: requires-python
44
+
45
+
46
+ # Holobit SDK - Documentación Oficial
47
+
48
+ ## 📌 Introducción
49
+ El **Holobit SDK** es un kit de desarrollo diseñado para la transpilación y ejecución de código holográfico cuántico. Su arquitectura multinivel permite trabajar con diferentes niveles de abstracción, optimizando el rendimiento en múltiples arquitecturas de hardware.
50
+
51
+ ## 🔹 Características Principales
52
+ - **Transpilador Cuántico Holográfico**: Convierte código HoloLang en código máquina optimizado para arquitecturas x86, ARM y RISC-V.
53
+ - **Optimización Avanzada**: Reduce instrucciones redundantes y reutiliza registros para maximizar la eficiencia.
54
+ - **Ejecución Multinivel**: Soporte para bajo, medio y alto nivel en la programación holográfica.
55
+ - **Compatibilidad con Múltiples Arquitecturas**: x86, ARM y RISC-V.
56
+
57
+ ## 📥 Instalación
58
+ Para instalar el SDK Holobit, sigue los siguientes pasos:
59
+
60
+ ### 🔹 Requisitos Previos
61
+ - **Python 3.10+**
62
+ - **pip** actualizado
63
+ - **Git (opcional, pero recomendado)**
64
+
65
+ ### 🔹 Instalación desde GitHub
66
+ ```bash
67
+ # Clonar el repositorio
68
+ git clone https://github.com/usuario/holobit_sdk.git
69
+ cd holobit_sdk
70
+
71
+ # Instalar dependencias
72
+ pip install -r requirements.txt
73
+ ```
74
+
75
+ ## 🚀 Uso del SDK
76
+ ### 🔹 Transpilación de Código HoloLang
77
+ Para transpilar un archivo de código holográfico:
78
+ ```bash
79
+ python transpiler/machine_code_transpiler.py --input archivo.holo --arch x86
80
+ ```
81
+ Esto generará un archivo con el código máquina optimizado para la arquitectura especificada.
82
+
83
+ ### 🔹 Ejemplo de Uso en Código
84
+ ```python
85
+ from transpiler.machine_code_transpiler import MachineCodeTranspiler
86
+
87
+ transpiler = MachineCodeTranspiler("x86")
88
+ instruccion = "ADD H1 H2"
89
+ codigo_maquina = transpiler.transpile(instruccion)
90
+ print(codigo_maquina) # ADD H1, H2 ; Registro reutilizado
91
+ ```
92
+
93
+ ## 🔬 Arquitectura Interna del SDK
94
+ El SDK Holobit está estructurado en varios niveles:
95
+ 1. **Nivel Bajo**: Manejo directo de registros y memoria holográfica.
96
+ 2. **Nivel Medio**: Procesamiento cuántico holográfico.
97
+ 3. **Nivel Alto**: Lenguaje de programación HoloLang y compilador asociado.
98
+
99
+ ## 📖 Referencia Técnica
100
+ - **Módulo `transpiler`**: Contiene el transpilador de código holográfico a código máquina.
101
+ - **Módulo `execution`**: Maneja la ejecución de código transpilado en arquitecturas objetivo.
102
+ - **Módulo `debugger`**: Herramientas de depuración y análisis de código transpilado.
103
+
104
+ ## 📄 Ejemplos de Código
105
+ ```holo
106
+ CREAR H1 (0.1, 0.2, 0.3)
107
+ IMPRIMIR H1
108
+ EJECUTAR ADD H1 H2
109
+ ```
110
+
111
+ ```bash
112
+ python transpiler/machine_code_transpiler.py --input ejemplo.holo --arch x86
113
+ ```
114
+
115
+ ## 📦 Despliegue y Distribución
116
+ El SDK Holobit será empaquetado y distribuido a través de **GitHub Releases** y **PyPI**.
117
+
118
+ ### 🔹 Construcción del Paquete
119
+ ```bash
120
+ python setup.py sdist bdist_wheel
121
+ ```
122
+
123
+ ### 🔹 Publicación en PyPI
124
+ ```bash
125
+ pip install twine
126
+
127
+ # Subir el paquete
128
+ python -m twine upload dist/*
129
+ ```
130
+
131
+ ## 🛠 Mantenimiento y Contribución
132
+ Si deseas contribuir al SDK Holobit, puedes hacer un **fork** del repositorio y enviar un **pull request** con tus mejoras.
133
+
134
+ ## 📧 Contacto y Soporte
135
+ Para cualquier consulta, reportes de errores o contribuciones, puedes contactarnos en **correo@holobit-sdk.com** o a través del repositorio en **GitHub**.
136
+
137
+ ---
138
+
139
+ 📌 **Holobit SDK - Computación Cuántica Holográfica para el Futuro** 🚀
140
+
@@ -0,0 +1,96 @@
1
+
2
+ # Holobit SDK - Documentación Oficial
3
+
4
+ ## 📌 Introducción
5
+ El **Holobit SDK** es un kit de desarrollo diseñado para la transpilación y ejecución de código holográfico cuántico. Su arquitectura multinivel permite trabajar con diferentes niveles de abstracción, optimizando el rendimiento en múltiples arquitecturas de hardware.
6
+
7
+ ## 🔹 Características Principales
8
+ - **Transpilador Cuántico Holográfico**: Convierte código HoloLang en código máquina optimizado para arquitecturas x86, ARM y RISC-V.
9
+ - **Optimización Avanzada**: Reduce instrucciones redundantes y reutiliza registros para maximizar la eficiencia.
10
+ - **Ejecución Multinivel**: Soporte para bajo, medio y alto nivel en la programación holográfica.
11
+ - **Compatibilidad con Múltiples Arquitecturas**: x86, ARM y RISC-V.
12
+
13
+ ## 📥 Instalación
14
+ Para instalar el SDK Holobit, sigue los siguientes pasos:
15
+
16
+ ### 🔹 Requisitos Previos
17
+ - **Python 3.10+**
18
+ - **pip** actualizado
19
+ - **Git (opcional, pero recomendado)**
20
+
21
+ ### 🔹 Instalación desde GitHub
22
+ ```bash
23
+ # Clonar el repositorio
24
+ git clone https://github.com/usuario/holobit_sdk.git
25
+ cd holobit_sdk
26
+
27
+ # Instalar dependencias
28
+ pip install -r requirements.txt
29
+ ```
30
+
31
+ ## 🚀 Uso del SDK
32
+ ### 🔹 Transpilación de Código HoloLang
33
+ Para transpilar un archivo de código holográfico:
34
+ ```bash
35
+ python transpiler/machine_code_transpiler.py --input archivo.holo --arch x86
36
+ ```
37
+ Esto generará un archivo con el código máquina optimizado para la arquitectura especificada.
38
+
39
+ ### 🔹 Ejemplo de Uso en Código
40
+ ```python
41
+ from transpiler.machine_code_transpiler import MachineCodeTranspiler
42
+
43
+ transpiler = MachineCodeTranspiler("x86")
44
+ instruccion = "ADD H1 H2"
45
+ codigo_maquina = transpiler.transpile(instruccion)
46
+ print(codigo_maquina) # ADD H1, H2 ; Registro reutilizado
47
+ ```
48
+
49
+ ## 🔬 Arquitectura Interna del SDK
50
+ El SDK Holobit está estructurado en varios niveles:
51
+ 1. **Nivel Bajo**: Manejo directo de registros y memoria holográfica.
52
+ 2. **Nivel Medio**: Procesamiento cuántico holográfico.
53
+ 3. **Nivel Alto**: Lenguaje de programación HoloLang y compilador asociado.
54
+
55
+ ## 📖 Referencia Técnica
56
+ - **Módulo `transpiler`**: Contiene el transpilador de código holográfico a código máquina.
57
+ - **Módulo `execution`**: Maneja la ejecución de código transpilado en arquitecturas objetivo.
58
+ - **Módulo `debugger`**: Herramientas de depuración y análisis de código transpilado.
59
+
60
+ ## 📄 Ejemplos de Código
61
+ ```holo
62
+ CREAR H1 (0.1, 0.2, 0.3)
63
+ IMPRIMIR H1
64
+ EJECUTAR ADD H1 H2
65
+ ```
66
+
67
+ ```bash
68
+ python transpiler/machine_code_transpiler.py --input ejemplo.holo --arch x86
69
+ ```
70
+
71
+ ## 📦 Despliegue y Distribución
72
+ El SDK Holobit será empaquetado y distribuido a través de **GitHub Releases** y **PyPI**.
73
+
74
+ ### 🔹 Construcción del Paquete
75
+ ```bash
76
+ python setup.py sdist bdist_wheel
77
+ ```
78
+
79
+ ### 🔹 Publicación en PyPI
80
+ ```bash
81
+ pip install twine
82
+
83
+ # Subir el paquete
84
+ python -m twine upload dist/*
85
+ ```
86
+
87
+ ## 🛠 Mantenimiento y Contribución
88
+ Si deseas contribuir al SDK Holobit, puedes hacer un **fork** del repositorio y enviar un **pull request** con tus mejoras.
89
+
90
+ ## 📧 Contacto y Soporte
91
+ Para cualquier consulta, reportes de errores o contribuciones, puedes contactarnos en **correo@holobit-sdk.com** o a través del repositorio en **GitHub**.
92
+
93
+ ---
94
+
95
+ 📌 **Holobit SDK - Computación Cuántica Holográfica para el Futuro** 🚀
96
+
File without changes
@@ -0,0 +1,27 @@
1
+ from core.quark import Quark
2
+ from core.holobit import Holobit
3
+ from visualization.projector import proyectar_holograma
4
+
5
+ # Crear 6 quarks con diferentes posiciones
6
+ q1 = Quark(0.1, 0.2, 0.3)
7
+ q2 = Quark(0.4, 0.5, 0.6)
8
+ q3 = Quark(0.7, 0.8, 0.9)
9
+ q4 = Quark(1.0, 1.1, 1.2)
10
+ q5 = Quark(1.3, 1.4, 1.5)
11
+ q6 = Quark(1.6, 1.7, 1.8)
12
+
13
+ # Crear antiquarks con posiciones opuestas a los quarks
14
+ antiquarks = [
15
+ Quark(-q.posicion[0], -q.posicion[1], -q.posicion[2])
16
+ for q in [q1, q2, q3, q4, q5, q6]
17
+ ]
18
+
19
+ # Crear el Holobit
20
+ h1 = Holobit([q1, q2, q3, q4, q5, q6], antiquarks)
21
+
22
+ # Realizar una rotación del Holobit
23
+ h1.rotar("z", 180)
24
+
25
+ # Proyectar el Holobit en un espacio 3D
26
+ proyectar_holograma(h1)
27
+
@@ -0,0 +1,32 @@
1
+ from assembler.parser import AssemblerParser
2
+ from visualization.projector import proyectar_holograma
3
+
4
+ # Instanciar el parser del ensamblador
5
+ parser = AssemblerParser()
6
+
7
+ # Definir un conjunto de instrucciones en lenguaje ensamblador
8
+ codigo_ensamblador = """
9
+ CREAR Q1 (0.1, 0.2, 0.3) ; Crear un quark Q1
10
+ CREAR Q2 (0.4, 0.5, 0.6) ; Crear un quark Q2
11
+ CREAR Q3 (0.7, 0.8, 0.9) ; Crear un quark Q3
12
+ CREAR Q4 (1.0, 1.1, 1.2) ; Crear un quark Q4
13
+ CREAR Q5 (1.3, 1.4, 1.5) ; Crear un quark Q5
14
+ CREAR Q6 (1.6, 1.7, 1.8) ; Crear un quark Q6
15
+
16
+ ; Crear un Holobit H1 a partir de los quarks
17
+ CREAR H1 {Q1, Q2, Q3, Q4, Q5, Q6}
18
+
19
+ ; Rotar el Holobit H1 en el eje Z
20
+ ROT H1 z 90
21
+ """
22
+
23
+
24
+ # Interpretar y ejecutar cada línea del código ensamblador
25
+ for linea in codigo_ensamblador.strip().split("\n"):
26
+ parser.parse_line(linea)
27
+
28
+ # Obtener el Holobit construido por el ensamblador
29
+ holobit = parser.holobits["H1"]
30
+
31
+ # Visualizar el Holobit resultante
32
+ proyectar_holograma(holobit)
File without changes
@@ -0,0 +1,140 @@
1
+ Metadata-Version: 2.2
2
+ Name: holobit-sdk
3
+ Version: 1.0.0
4
+ Summary: SDK para la transpilación y ejecución de código holográfico cuántico.
5
+ Home-page: https://github.com/Alphonsus411/holobit_SDK
6
+ Author: Tu Nombre
7
+ Author-email: Adolfo González Hernández <adolfogonzal@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2024
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
30
+ Project-URL: Homepage, https://github.com/Alphonsus411/holobit_SDK
31
+ Project-URL: Bug Tracker, https://github.com/Alphonsus411/holobit_SDK/issues
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Operating System :: OS Independent
35
+ Requires-Python: >=3.10
36
+ Description-Content-Type: text/markdown
37
+ License-File: LICENSE
38
+ Requires-Dist: setuptools
39
+ Requires-Dist: wheel
40
+ Requires-Dist: twine
41
+ Dynamic: author
42
+ Dynamic: home-page
43
+ Dynamic: requires-python
44
+
45
+
46
+ # Holobit SDK - Documentación Oficial
47
+
48
+ ## 📌 Introducción
49
+ El **Holobit SDK** es un kit de desarrollo diseñado para la transpilación y ejecución de código holográfico cuántico. Su arquitectura multinivel permite trabajar con diferentes niveles de abstracción, optimizando el rendimiento en múltiples arquitecturas de hardware.
50
+
51
+ ## 🔹 Características Principales
52
+ - **Transpilador Cuántico Holográfico**: Convierte código HoloLang en código máquina optimizado para arquitecturas x86, ARM y RISC-V.
53
+ - **Optimización Avanzada**: Reduce instrucciones redundantes y reutiliza registros para maximizar la eficiencia.
54
+ - **Ejecución Multinivel**: Soporte para bajo, medio y alto nivel en la programación holográfica.
55
+ - **Compatibilidad con Múltiples Arquitecturas**: x86, ARM y RISC-V.
56
+
57
+ ## 📥 Instalación
58
+ Para instalar el SDK Holobit, sigue los siguientes pasos:
59
+
60
+ ### 🔹 Requisitos Previos
61
+ - **Python 3.10+**
62
+ - **pip** actualizado
63
+ - **Git (opcional, pero recomendado)**
64
+
65
+ ### 🔹 Instalación desde GitHub
66
+ ```bash
67
+ # Clonar el repositorio
68
+ git clone https://github.com/usuario/holobit_sdk.git
69
+ cd holobit_sdk
70
+
71
+ # Instalar dependencias
72
+ pip install -r requirements.txt
73
+ ```
74
+
75
+ ## 🚀 Uso del SDK
76
+ ### 🔹 Transpilación de Código HoloLang
77
+ Para transpilar un archivo de código holográfico:
78
+ ```bash
79
+ python transpiler/machine_code_transpiler.py --input archivo.holo --arch x86
80
+ ```
81
+ Esto generará un archivo con el código máquina optimizado para la arquitectura especificada.
82
+
83
+ ### 🔹 Ejemplo de Uso en Código
84
+ ```python
85
+ from transpiler.machine_code_transpiler import MachineCodeTranspiler
86
+
87
+ transpiler = MachineCodeTranspiler("x86")
88
+ instruccion = "ADD H1 H2"
89
+ codigo_maquina = transpiler.transpile(instruccion)
90
+ print(codigo_maquina) # ADD H1, H2 ; Registro reutilizado
91
+ ```
92
+
93
+ ## 🔬 Arquitectura Interna del SDK
94
+ El SDK Holobit está estructurado en varios niveles:
95
+ 1. **Nivel Bajo**: Manejo directo de registros y memoria holográfica.
96
+ 2. **Nivel Medio**: Procesamiento cuántico holográfico.
97
+ 3. **Nivel Alto**: Lenguaje de programación HoloLang y compilador asociado.
98
+
99
+ ## 📖 Referencia Técnica
100
+ - **Módulo `transpiler`**: Contiene el transpilador de código holográfico a código máquina.
101
+ - **Módulo `execution`**: Maneja la ejecución de código transpilado en arquitecturas objetivo.
102
+ - **Módulo `debugger`**: Herramientas de depuración y análisis de código transpilado.
103
+
104
+ ## 📄 Ejemplos de Código
105
+ ```holo
106
+ CREAR H1 (0.1, 0.2, 0.3)
107
+ IMPRIMIR H1
108
+ EJECUTAR ADD H1 H2
109
+ ```
110
+
111
+ ```bash
112
+ python transpiler/machine_code_transpiler.py --input ejemplo.holo --arch x86
113
+ ```
114
+
115
+ ## 📦 Despliegue y Distribución
116
+ El SDK Holobit será empaquetado y distribuido a través de **GitHub Releases** y **PyPI**.
117
+
118
+ ### 🔹 Construcción del Paquete
119
+ ```bash
120
+ python setup.py sdist bdist_wheel
121
+ ```
122
+
123
+ ### 🔹 Publicación en PyPI
124
+ ```bash
125
+ pip install twine
126
+
127
+ # Subir el paquete
128
+ python -m twine upload dist/*
129
+ ```
130
+
131
+ ## 🛠 Mantenimiento y Contribución
132
+ Si deseas contribuir al SDK Holobit, puedes hacer un **fork** del repositorio y enviar un **pull request** con tus mejoras.
133
+
134
+ ## 📧 Contacto y Soporte
135
+ Para cualquier consulta, reportes de errores o contribuciones, puedes contactarnos en **correo@holobit-sdk.com** o a través del repositorio en **GitHub**.
136
+
137
+ ---
138
+
139
+ 📌 **Holobit SDK - Computación Cuántica Holográfica para el Futuro** 🚀
140
+
@@ -0,0 +1,17 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ requirements.txt
6
+ setup.py
7
+ examples/[quantum_example.py]
8
+ examples/example1.py
9
+ examples/example2.py
10
+ holobit_sdk/__init__.py
11
+ holobit_sdk.egg-info/PKG-INFO
12
+ holobit_sdk.egg-info/SOURCES.txt
13
+ holobit_sdk.egg-info/dependency_links.txt
14
+ holobit_sdk.egg-info/entry_points.txt
15
+ holobit_sdk.egg-info/requires.txt
16
+ holobit_sdk.egg-info/top_level.txt
17
+ tests/test_parser.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ holobit-transpiler = transpiler.machine_code_transpiler:main
@@ -0,0 +1,3 @@
1
+ setuptools
2
+ wheel
3
+ twine
@@ -0,0 +1 @@
1
+ holobit_sdk
@@ -0,0 +1,35 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "holobit-sdk"
7
+ version = "1.0.0"
8
+ description = "SDK para la transpilación y ejecución de código holográfico cuántico."
9
+ readme = "README.md"
10
+ authors = [{ name = "Adolfo González Hernández", email = "adolfogonzal@gmail.com" }]
11
+ license = { file = "LICENSE" }
12
+ dependencies = [
13
+ "setuptools",
14
+ "wheel",
15
+ "twine"
16
+ ]
17
+ requires-python = ">=3.10"
18
+ classifiers = [
19
+ "Programming Language :: Python :: 3",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Operating System :: OS Independent"
22
+ ]
23
+
24
+ [project.urls]
25
+ "Homepage" = "https://github.com/Alphonsus411/holobit_SDK"
26
+ "Bug Tracker" = "https://github.com/Alphonsus411/holobit_SDK/issues"
27
+
28
+ [project.scripts]
29
+ holobit-transpiler = "transpiler.machine_code_transpiler:main"
30
+
31
+ [tool.setuptools]
32
+ packages = ["holobit_sdk"]
33
+
34
+ [tool.setuptools.package-data]
35
+ holobit_sdk = ["*.md", "docs/*", "examples/*"]
Binary file
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,29 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="holobit-sdk",
5
+ version="1.0.0",
6
+ author="Tu Nombre",
7
+ author_email="tuemail@example.com",
8
+ description="SDK para la transpilación y ejecución de código holográfico cuántico.",
9
+ long_description=open("README.md", encoding="utf-8").read(),
10
+ long_description_content_type="text/markdown",
11
+ url="https://github.com/Alphonsus411/holobit_SDK",
12
+ packages=find_packages(),
13
+ classifiers=[
14
+ "Programming Language :: Python :: 3",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Operating System :: OS Independent",
17
+ ],
18
+ python_requires=">=3.10",
19
+ install_requires=[
20
+ "setuptools",
21
+ "wheel",
22
+ "twine"
23
+ ],
24
+ entry_points={
25
+ "console_scripts": [
26
+ "holobit-transpiler=transpiler.machine_code_transpiler:main",
27
+ ],
28
+ },
29
+ )
@@ -0,0 +1,108 @@
1
+ import unittest
2
+ from assembler.parser import AssemblerParser
3
+ from core.holobit import Quark, Holobit
4
+
5
+
6
+ class TestAssemblerParser(unittest.TestCase):
7
+ def setUp(self):
8
+ """
9
+ Configuración inicial antes de cada prueba.
10
+ """
11
+ self.parser = AssemblerParser()
12
+
13
+ def test_crear_quark(self):
14
+ """
15
+ Prueba la creación de un quark.
16
+ """
17
+ line = "CREAR Q1 (0.1, 0.2, 0.3)"
18
+ self.parser.parse_line(line)
19
+ self.assertIn("Q1", self.parser.holobits)
20
+ self.assertIsInstance(self.parser.holobits["Q1"], Quark)
21
+
22
+ def test_crear_quark_coordenadas_invalidas(self):
23
+ invalid_coords = [
24
+ "CREAR Q1 (0.1, 0.2)", # Faltan coordenadas
25
+ "CREAR Q1 (0.1, 0.2, texto)", # Coordenada no numérica
26
+ "CREAR Q1 (0.1,)", # Coordenada incompleta
27
+ "CREAR Q1 0.1, 0.2, 0.3", # Sin paréntesis
28
+ "CREAR Q1 ()", # Vacío
29
+ "CREAR Q1 (0.1 0.2, 0.3)" # Falta coma
30
+ ]
31
+ for line in invalid_coords:
32
+ with self.assertRaises(ValueError):
33
+ self.parser.parse_line(line)
34
+
35
+ def test_crear_holobit(self):
36
+ for i in range(1, 7):
37
+ self.parser.parse_line(f"CREAR Q{i} ({i * 0.1:.1f}, {i * 0.2:.1f}, {i * 0.3:.1f})")
38
+ self.parser.parse_line("CREAR H1 {Q1, Q2, Q3, Q4, Q5, Q6}")
39
+
40
+ def test_crear_holobit_referencias_invalidas(self):
41
+ """
42
+ Prueba un Holobit con referencias inexistentes.
43
+ """
44
+ line = "CREAR H1 {Q1, Q2, Q3, Q4, Q5, Q6}" # Sin crear los quarks
45
+ with self.assertRaises(KeyError):
46
+ self.parser.parse_line(line)
47
+
48
+ def test_instruccion_invalida(self):
49
+ """
50
+ Prueba una instrucción no reconocida.
51
+ """
52
+ with self.assertRaises(ValueError):
53
+ self.parser.parse_line("INVALID H1")
54
+
55
+ def test_rotar_holobit(self):
56
+ """
57
+ Prueba la rotación de un Holobit.
58
+ """
59
+ # Crear quarks necesarios
60
+ for i in range(1, 7):
61
+ self.parser.parse_line(f"CREAR Q{i} ({i * 0.1}, {i * 0.2}, {i * 0.3})")
62
+
63
+ # Crear Holobit
64
+ self.parser.parse_line("CREAR H1 {Q1, Q2, Q3, Q4, Q5, Q6}")
65
+
66
+ # Rotar Holobit
67
+ self.parser.parse_line("ROT H1 z 90")
68
+ self.assertIn("H1", self.parser.holobits)
69
+
70
+ def test_rotar_holobit_angulo_invalido(self):
71
+ """
72
+ Prueba la rotación de un Holobit con un ángulo inválido.
73
+ """
74
+ # Crear quarks necesarios
75
+ for i in range(1, 7):
76
+ self.parser.parse_line(f"CREAR Q{i} ({i * 0.1}, {i * 0.2}, {i * 0.3})")
77
+
78
+ # Crear Holobit
79
+ self.parser.parse_line("CREAR H1 {Q1, Q2, Q3, Q4, Q5, Q6}")
80
+
81
+ with self.assertRaises(ValueError):
82
+ self.parser.parse_line("ROT H1 z texto") # Ángulo no numérico
83
+
84
+ def test_rotar_holobit_eje_invalido(self):
85
+ """
86
+ Prueba la rotación de un Holobit con un eje inválido.
87
+ """
88
+ # Crear quarks necesarios
89
+ for i in range(1, 7):
90
+ self.parser.parse_line(f"CREAR Q{i} ({i * 0.1}, {i * 0.2}, {i * 0.3})")
91
+
92
+ # Crear Holobit
93
+ self.parser.parse_line("CREAR H1 {Q1, Q2, Q3, Q4, Q5, Q6}")
94
+
95
+ with self.assertRaises(ValueError):
96
+ self.parser.parse_line("ROT H1 invalid 90") # Eje inválido
97
+
98
+ def test_rotar_holobit_invalido(self):
99
+ """
100
+ Prueba la rotación de un Holobit inexistente.
101
+ """
102
+ line = "ROT H1 z 90" # Holobit no creado
103
+ with self.assertRaises(KeyError):
104
+ self.parser.parse_line(line)
105
+
106
+
107
+ if __name__ == "__main__":
108
+ unittest.main()