Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion interfaces/CMakeLists.txt → CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.11)
project(qsim)

set(CMAKE_CXX_FLAGS "-O3 -mavx2 -mfma -fopenmp -lgomp")
Expand Down
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include requirements.txt
include CMakeLists.txt

graft pybind_interface
graft lib
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ qsim:

.PHONY: pybind
pybind:
$(MAKE) -C interfaces/ pybind
$(MAKE) -C pybind_interface/ pybind

.PHONY: cxx-tests
tests:
Expand All @@ -33,10 +33,11 @@ tests:
run-cxx-tests: cxx-tests
$(MAKE) -C tests/ run-all

# TODO: support python tests
PYTESTS = $(shell find interfaces/tests/ -name '*_test.py')

.PHONY: run-py-tests
run-py-tests: pybind
$(MAKE) -C interfaces/ run-tests
for exe in $(PYTESTS); do if ! python3 -m pytest $$exe; then exit 1; fi; done

.PHONY: run-tests
run-tests: $(TESTS)
Expand All @@ -45,4 +46,4 @@ run-tests: $(TESTS)
clean:
-$(MAKE) -C apps/ clean
-$(MAKE) -C tests/ clean
-$(MAKE) -C interfaces/ clean
-$(MAKE) -C pybind_interface/ clean
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ services:
container_name: qsim-py-tests
build:
context: ./
dockerfile: interfaces/Dockerfile
dockerfile: pybind_interface/Dockerfile
depends_on:
- qsim
23 changes: 0 additions & 23 deletions interfaces/Makefile

This file was deleted.

54 changes: 0 additions & 54 deletions interfaces/examples/pybind_interface_examples.py

This file was deleted.

111 changes: 0 additions & 111 deletions interfaces/examples/qsimcirq_examples.py

This file was deleted.

17 changes: 0 additions & 17 deletions interfaces/pybind_interface/make.sh

This file was deleted.

1 change: 0 additions & 1 deletion interfaces/qsimcirq/__init__.py

This file was deleted.

2 changes: 2 additions & 0 deletions interfaces/Dockerfile → pybind_interface/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ RUN apt-get install -y python3-dev python3-pybind11 python3-pytest python3-pip
RUN pip3 install cirq

# Copy relevant files
COPY ./pybind_interface/ /qsim/pybind_interface/
COPY ./qsimcirq/ /qsim/qsimcirq/
COPY ./interfaces/ /qsim/interfaces/

WORKDIR /qsim/
Expand Down
13 changes: 13 additions & 0 deletions pybind_interface/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# The name of the shared library that results after compiling qsim for Pybind11
QSIMLIB = ../qsimcirq/qsim`python3-config --extension-suffix`

# The flags for the compilation of the Pybind11 interface
PYBINDFLAGS = -Wall -shared -std=c++17 -fPIC `python3 -m pybind11 --includes`

.PHONY: pybind
pybind:
$(CXX) pybind_main.cpp -o $(QSIMLIB) $(CXXFLAGS) $(PYBINDFLAGS)

.PHONY: clean
clean:
-rm -f ./*.x ./*.a ./*.so ./*.mod $(QSIMLIB)
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
#include <string>
#include <vector>

#include "../../lib/bitstring.h"
#include "../../lib/circuit_reader.h"
#include "../../lib/fuser_basic.h"
#include "../../lib/gate.h"
#include "../../lib/io.h"
#include "../../lib/parfor.h"
#include "../../lib/run_qsim.h"
#include "../../lib/run_qsimh.h"
#include "../../lib/simulator_avx.h"
#include "../../lib/util.h"
#include "../lib/bitstring.h"
#include "../lib/circuit_reader.h"
#include "../lib/fuser_basic.h"
#include "../lib/gate.h"
#include "../lib/io.h"
#include "../lib/parfor.h"
#include "../lib/run_qsim.h"
#include "../lib/run_qsimh.h"
#include "../lib/simulator_avx.h"
#include "../lib/util.h"

using namespace qsim;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion interfaces/setup.py → setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def build_extension(self, ext):
version='0.0.1',
author='Vamsi Krishna Devabathini',
author_email='devabathini92@gmail.com',
python_requires=('>=3.0.0'),
python_requires=('>=3.3.0'),
install_requires=requirements,
license='Apache 2',
description='',
Expand Down