This directory contains the code that generates Figures A.7 and A.8 in the body of the BsC thesis. The scripts generate visualizations of the density matrices and the Bloch sphere representation for both a pure state and a mixed state.
-
Toffoli_visualization.py
:- Script that decomposes the Toffoli gate (CCNOT) into basic quantum gates.
- Generates a black and white diagram of the decomposition and saves it as
toffoli_decomposed_bw.png
.
-
Bloch_visualization.py
: -
Script that generates visualizations of:
- Pure and mixed states on the Bloch sphere.
- 3D density matrix representations.
-
Expected outputs:
Bloch_pure_state.png
: Representation of a pure state.Bloch_mixed_state.png
: Representation of a mixed state.Density_pure_state.png
: Density matrix of the pure state.Density_mixed_state.png
: Density matrix of the mixed state.
Requirements:
- Python 3.8+
- Dependencies:
Install dependencies using pip
:
pip install qiskit matplotlib
Run the script:
python Toffoli_visualization.py
The image will be generated as toffoli_decomposed_bw.png
.
Run the script:
python Bloch_visualization.py
Generated files:
Bloch_pure_state.png
Bloch_mixed_state.png
Density_pure_state.png
Density_mixed_state.png
- Bloch Sphere:
- Density matrix:
- Decomposition of the Toffoli Gate:
This project is licensed under the same terms as the BSc thesis it is derived from. Please refer to the thesis documentation for specific licensing details and any applicable restrictions.
For questions or suggestions related specifically to this thesis, please contact:
- Name: Ricard Santiago Raigada García
- Email: rraigadag@uoc.edu