Commit Graph

188 Commits

Author SHA1 Message Date
giangiac 0c79114899 Change name of python library if IqsMPI=ON
When IqsMPI=OFF, the name is: intelqs_py
When IqsMPI=ON , the name is: intelqs_py_mpi
2021-03-09 10:25:36 -08:00
giangiac 3698396102 Remove the issues highlighted by Bandit in Python scripts
Bandit is a software tool to identify vulnerabilities in Python code.
Two type of vulnerabilities were identified (both low severity):
1. use of assert
2. import of pickle
Both issues have been removed.
2021-02-23 18:45:54 -08:00
giangiac 94b3112438 Remove TODO messages at compile time
As a record of the TODO suggestions, the messages have been collected
in docs/todo_list.md while they are still part of the source code
as comments.
2021-02-16 12:38:02 -08:00
giangiac 6756b48dcb Minor edits to README 2021-02-16 11:22:03 -08:00
giangiac b0f713151b Reduce README by moving part of its content to /docs 2021-02-16 11:15:24 -08:00
giangiac 832e748a04 Rename Python scripts 2021-02-16 10:19:03 -08:00
giangiac a3e273904c Update Python scripts 2021-02-16 10:08:58 -08:00
Gian Giacomo Guerreschi b69abe6489 Add option MPI on/off to launcher of examples 2021-02-16 09:53:44 -08:00
Gian Giacomo Guerreschi 472bc6b5d4 Edit CMake build to allow for clang compiler 2021-02-16 09:28:32 -08:00
Gian Giacomo Guerreschi 2640d573eb Code cleaning to eliminate warnings from clang compiler
Mostly, warning that operator << has lower precedence than operator +:
  1UL << c + 1UL     ---->    1UL << (c + 1UL)
2021-02-16 09:27:40 -08:00
giangiac c741d706f7 Add method to MPIEnvironment that returns the size of WORLD_COMM
In fact other methods like GetStateSize() or GetPoolSize()
access information from the on the useful ranks only,
neglecting the dummy processes. The new method access
directly MPI_Comm_size(MPI_COMM_WORLD, ...) and returns
its value.
2021-02-15 20:02:07 -08:00
giangiac 1f9077bcdc Include class Timer and QubitRegister methods for specialization into namespace iqs 2021-02-15 19:32:30 -08:00
giangiac 4fd942dde4 Add launcher to run all examples sequentially 2021-02-15 18:38:04 -08:00
giangiac 35cd65708b Change namespace from qhipster to iqs
In addition, a few classes that were outside the qhipster namespace
(for example QubitRegister, Permutation, NoisyQureg)
are now part of iqs namespace.
2021-02-12 19:23:51 -08:00
giangiac 336f9bfa7f Updated python script and Jupyter notebook on chi-matrix 2021-02-12 16:56:40 -08:00
giangiac efd9066c31 Update Jupyter notebook on noise via chi-matrix 2021-02-12 16:16:06 -08:00
giangiac b8f7ccc5e3 Move declaration of extract_value_type from qureg.hpp to utils.hpp
This structure is used by class ChiMatrix, but there is no need
to include qureg.hpp in chi_matrix.hpp
2021-02-12 16:15:18 -08:00
Guerreschi, Gian Giacomo 0c3863a609 Merge branch 'develop/chi-matrix' into 'release/2021-03'
Develop/chi matrix

See merge request aqua/Intel-QS!2
2021-02-12 10:32:39 -08:00
Guerreschi, Gian Giacomo a798afe624 Update tinymatrix.hpp
Mostly the style of comments and indentation.
2021-02-12 10:32:39 -08:00
Markus Buchberger 7761d2dea7
Contribute mbu (#35)
* Add badge for Python build in README

* Create the python build with MPI: Action

* Update python MPI action

* Added the installation of MPICH in the Action

* deleted the file for the action

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CMakeLists.txt

For g++ compiler, use option "-O3" to optimize the binary.

* Update example grover_4qubit.cpp

* fixes to Dockerfile, get_started_examples

* Update python_build_mpi.yml

* Update python_build_no_mpi.yml

* Update Dockerfile

* Update import_iqs.py

Updated syntax for init and finalize functions for the MPI environment

Co-authored-by: giangiac <30329377+giangiac@users.noreply.github.com>
Co-authored-by: Fabio Baruffa <fbaru.dev@gmail.com>
Co-authored-by: giangiac <gian.giacomo.guerreschi@intel.com>
2021-01-26 15:32:12 -08:00
cangumeli 64510dbeb4
MPI support for specialize version 2 (#30)
* Prototype gate spec v2

* Fix formatting

* Fix formatting hadamard3d

* Add benchmark for spec v2

* Fix argument name in 1 bit ctrl gates

* Make spec v2 benchmark MPI compatible

* Draft spec v2 MPI

* Fix spec v2 rotation bugs

* Add spec v2 state comparison test with full gate coverage

* Fix loop exit

* Add timer and exception

* Fix indentation

* Refactor and comment the basic spec v2 code

* Improve documentation and formatting

* Add MPI support for 1-qubit gates

* Add spec v2 MPI for controlled gates

* Add timing to spec v2 Loop_SN

* Disable spec v1 for large MPI ranks

* Refer to declarations for new spec v2 function arguments

Co-authored-by: cgumeli <can.gumeli@intel.com>
Co-authored-by: Can Gumeli <cangumeli@pop-os.localdomain>
2021-01-26 15:25:33 -08:00
giangiac 5d1c0ca8fd Minor edits for doxygen comments 2020-11-19 16:58:11 -08:00
giangiac d13796fc0f Update example of Python script 2020-11-19 16:16:11 -08:00
giangiac 14748a5a41 Merge branch 'development' of github.com:iqusoft/intel-qs into development 2020-11-19 15:42:24 -08:00
Stanley 22446d4df0
Enabled readthedocs for Intel QS (#40)
* Added markdown with Sphinx
Added .md and .rst into the markdown parser

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Added CONTRIBUTING.md

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Restructuring the project

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Added ipynb source

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Pushing requirements.txt

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Remove the pkg-resources: bug

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Added one more example and fixed the title for GST

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Fixed title again

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Fixing titles for getting started

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Fixing ipynb title

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Added Exhale, Breathe for Doxygen support

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Remove the bug again

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Fixed the relative path for doxygen

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Updated the gitignore to ignore output from doxygen

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Fixed section title and ipynb title

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Finally fixed Example 1 and Example 2 markdown to show up

Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>

* Update import_iqs.py

update the syntax of init and finalize functions for the MPI environment

* Update python_build_no_mpi.yml

test of new workflow to setup Miniconda

* Update python_build_mpi.yml

Co-authored-by: giangiac <30329377+giangiac@users.noreply.github.com>
2020-11-18 08:16:44 -08:00
giangiac d11a843140 Merge branch 'development' of github.com:iqusoft/intel-qs into development 2020-11-17 10:33:53 -08:00
Wei Hu b2944cd2ac
Fix typos in comments (#37)
Commit improve the quality of the comments without changing the code.
2020-11-17 10:30:19 -08:00
giangiac 50a51810af Update communication_reduction_via_qubit_reordering.cpp 2020-11-09 13:55:52 -08:00
giangiac d7e757f914 Add example using PermuteQubits()
In the example 'communication_reduction_via_qubit_reordering.cpp',
we simulate a simple circuit (with gates on the last 10 qubits only)
using the trivial qubit ordering and the inverse one.
With increasing number of MPI processes, the relative cost of the
simulation with inverse qubit order (w.r.t. the simulation with
trivial qubit order) decreases.
This is expected since no MPI communication is needed for the inverse order.
2020-11-09 13:47:47 -08:00
giangiac d9dd5914f6 Add tutorial for MPI-enabled noisy simulations in Python 2020-11-09 12:42:15 -08:00
giangiac f03abdeb15 Add a few methods from qhipster::mpi::Environment to Python bindings 2020-11-09 12:35:38 -08:00
giangiac c58555f267 Update MPI init and finalize in Python bindings
For naming consistency, the MPI environment is initialized via:
  iqs.EnvInit()
and the finalization via:
  iqs.EnvFinalize()

when the number of ranks is not a power of 2 or, in general, when some
of the ranks are dummy, we need to finalize them and terminate their execution
before proceding with the actual program.
The Python examples '/notebooks/python_mpi.py' and '/notebooks/python_script.py'
include appropriate code.
2020-11-09 11:08:49 -08:00
giangiac 9cacfc7117 Update to CHANGELOG 2020-10-20 10:40:23 -07:00
giangiac 729f4436c1 Add CHANGELOG file 2020-10-20 10:32:11 -07:00
giangiac a0d99e972a Minor update in QFT example 2020-10-15 22:22:17 -07:00
Nur Fadel 2156494287
fix to compile with openMPI 4 on ubuntu 20.04 (#29)
* fix - use the right `resize` method

* fix to run with openMPI4.0 on ubuntu 20.04 - removed deprecated MPI keyword
2020-08-31 16:35:35 +02:00
cangumeli 52ac7e9164
Feature/omp spec (#27)
* Prototype gate spec v2

* Fix formatting

* Fix formatting hadamard3d

* Add benchmark for spec v2

* Fix argument name in 1 bit ctrl gates

* Make spec v2 benchmark MPI compatible

* Fix spec v2 rotation bugs

* Add spec v2 state comparison test with full gate coverage

* Fix loop exit

* Add timer and exception

* Fix indentation

* Refactor and comment the basic spec v2 code

* Improve documentation and formatting

Co-authored-by: Can Gumeli <cangumeli@pop-os.localdomain>
2020-08-31 16:31:09 +02:00
giangiac 7d823d17e2 Merge branch 'development' of github.com:iqusoft/intel-qs into development 2020-08-12 11:19:43 -07:00
giangiac d6709b0daf Add iPython preentation with basic use of IQS 2020-08-12 11:18:45 -07:00
Fabio Baruffa 9ab0159752
Test done on Action: successful 2020-08-11 08:50:18 +02:00
Fabio Baruffa 41d1077a08
Update docker yaml file:testing action 2020-08-10 14:27:39 +02:00
Fabio Baruffa c7cbca106c
Update of the Readme file 2020-08-10 14:25:35 +02:00
Fabio Baruffa 50e26d0de0
Update docker image yaml file 2020-08-07 15:11:22 +02:00
Fabio Baruffa 35d04f81e4
Update dicker-imahe yaml 2020-08-07 15:07:33 +02:00
Fabio Baruffa adef6a99c1
Patch to add the docker workflow in the automation (#28)
Add automation for Docker creation
2020-08-07 15:06:20 +02:00
Fabio Baruffa 9ccd34792e
Point to the new Dockerfile in the development branch 2020-08-07 14:56:49 +02:00
rashed2940 9237496614
Dockerfile modification_automated Intel Quantum simulator launching process in a container (#25)
* adding modified Dockerfile and README

* adding modified Dockerfile and README

* adding modified README file

* adding modified README file

* adding modified README file

* removed proxy in Dockerfile andadded docker badgein README file

* modified README file

* modified README file and ipynb in tutorials folder

Co-authored-by: Bin Mohammad <sk.rashed.bin.mohammad@intel.com>
2020-08-07 14:53:11 +02:00
giangiac 4f5065394f
Feature/qubit ordering (#24)
Add the possibility of reordering the qubits at the level of the data storage.

Consider that we have N qubits distributed among 2^P processes.
Previously:
* the first M=N-P qubits were local
* the last P qubits were global
Now we can choose the qubit order for storage and therefore select any M qubits to be local.
This possibility helps reducing the simulation time by avoiding MPI communication overhead.

Implementation:
* Add distributed implementation of (symmetric) SWAP-like gates.
* Extend class Permutation.
* Add documentation inside qureg.hpp about storage conventions.
* 'qubit' indicates program qubits, 'position' indicates data qubits
* GetGlobalAmplitude(index) returns the amplitude corresponding to the global index in input, considering that such index is expressed in terms of program qubits while the actual state is stored according to the data qubit order.
* Add QubitRegister functions to permute qubits. For example PermuteQubits(), PermuteLocalQubits(), ...
* Add unit tests covering the class Permutation class and novel QubitRegister methods.
2020-08-04 12:10:04 -07:00
Nur Fadel 74421f1284
fix - use the right `resize` method (#23)
correct typos in qureg_init.cpp
2020-07-13 09:38:12 -07:00
cangumeli eafade6e16
Enable Compiler Optimization in GCC (#21)
* Set compiler optimization for GCC

* Fix duplication
2020-06-16 11:00:22 +02:00