Complex numbers are an extension of real numbers and are represented in the form 𝑎+𝑏𝑖, where 𝑎 and 𝑏 are real numbers and 𝑖 is the imaginary unit that satisfies the equation 𝑖²=−1. These numbers are fundamental in quantum computing.
- Libcplx.py: This file contains a Python library with eight essential operations for working with complex numbers:
- Addition: Performs the addition of two complex numbers.
- Subtraction: Calculates the difference between two complex numbers.
- Multiplication: Multiplies two complex numbers.
- Division: Divides one complex number by another.
- Modulus: Calculates the magnitude or modulus of a complex number.
- Conjugate: Determines the conjugate of a complex number.
- Polar and Cartesian Conversion: Allows conversion between the polar and Cartesian forms of a complex number.
- Phase: Calculates the phase angle of a complex number.
- Testlibcpx.py: This file provides unit tests to verify the correct functionality of the functions implemented in Libcplx.py. The tests ensure that operations with complex numbers are performed accurately and reliably.
To run the Python files provided in this repository, follow these steps:
Ensure that the Libcplx.py and Testlibcpx.py files are in the same directory so the script can find all necessary resources.
Open a terminal or command line and navigate to the folder where the files are located.
Then, run the Testlibcplx.py file.
This folder contains the weekly workshops corresponding to the subject CNYT (Natural Sciences and Technology). The purpose of these workshops is to provide practice to improve the handling of key tools and concepts in the field of quantum computing.
-
ComplexIntro.ipynb
Purpose: Practice basic functions and operations with complex numbers. This file includes exercises to operate and plot complex numbers in the complex plane. -
Complex_Vector_Matrix_Operations_with_NumPy.ipynb
Purpose: Perform operations on matrices and column vectors using the NumPy library. Includes exercises for manipulating and calculating matrices and vectors. -
TallerEsp.Vect-ProdInterno-VectoPropios
Purpose: Calculate inner products, eigenvalues, and eigenvectors of matrices. -
TallerEsp.Vect-Hermitian-Unitary-Tensor-Circuits
Purpose: Apply the above concepts to quantum systems. Includes exercises on Hermitian matrices, unitary operations, and circuits.
- Environment Setup: Make sure you have a Python 3.12.0 virtual environment configured.
Activate the virtual environment:
- On Windows:
.venv\Scripts\activate
- On macOS and Linux:
source .venv/bin/activate
- Install Dependencies: Once the virtual environment is activated, install the necessary dependencies using the following command:
pip install numpy matplotlib ipywidgets
Classical discrete systems are characterized by having a finite number of possible states, allowing the use of statistical tools to predict outcomes. In contrast, the double-slit experiment reveals the probabilistic nature of particles.
TallerClasicToQuantum.ipynb
Purpose: Implement discrete systems in a probabilistic double-slit problem and calculate the probabilities of each state.
- Environment Setup: Make sure you have a Python 3.12.0 virtual environment configured.
Activate the virtual environment:
- On Windows:
.venv\Scripts\activate
- On macOS and Linux:
source .venv/bin/activate
- Install Dependencies: Once the virtual environment is activated, install the necessary dependencies using the following command:
pip install numpy matplotlib
Observables are physical quantities that can be measured due to their probabilistic nature, definition of states, and interaction with the environment.
Quantum.ipynb
Purpose: Implement concepts from quantum theory focusing on the calculation of observables and the analysis of the impact of measurements on quantum states.
Write down the generic state vector for the system of two particles with spin. Generalize it to a system with n particles (this is important: it will be the physical realization for quantum registers!).
The basic states of a particle with spin are:
$$\ | \uparrow \rangle $$ $$\ | \downarrow \rangle $$
Assembling a quantum system of two particles results in the tensor product between each state:
$$\ | \uparrow \rangle \otimes | \uparrow \rangle $$ $$\ | \uparrow \rangle \otimes | \downarrow \rangle $$ $$\ | \downarrow \rangle \otimes | \uparrow \rangle $$ $$\ | \downarrow \rangle \otimes | \downarrow \rangle $$
These states can be expressed as a linear combination with their coefficients:
Analyzing this equation, it can be inferred that it fits the form
Assume the same scenario as in Example 4.5.2 and let
Is this state separable?
A state is separable if it can be written in the form:
The tensor product respects addition in
This means that this state is separable in a non-trivial system of two particles.
- Environment Setup: Make sure you have a Python 3.12.0 virtual environment configured.
Activate the virtual environment:
- On Windows:
.venv\Scripts\activate
- On macOS and Linux:
source .venv/bin/activate
- Install Dependencies: Once the virtual environment is activated, install the necessary dependencies using the following command:
pip install numpy matplotlib
Santiago Botero - LePeanutButter