Coder Social home page Coder Social logo

libtangle / qcgpu Goto Github PK

View Code? Open in Web Editor NEW
434.0 21.0 50.0 20.93 MB

High Performance Tools for Quantum Computing

License: MIT License

Jupyter Notebook 47.38% Python 50.30% Makefile 1.01% Batchfile 1.31%
quantum-computing quantum-computer-simulator gate qubits quantum opencl python

qcgpu's People

Contributors

adamisntdead avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qcgpu's Issues

Error when installing.

When I attempt to download the package via pip, it fails. The error code I received is included below.

Collecting qcgpu
Using cached https://files.pythonhosted.org/packages/b6/fa/170edf5e1a17e9d6f981cdf8c9c0aec278562e3b4d8db2f82dbe541e416e/qcgpu-0.1.0-py3-none-any.whl
Requirement already satisfied: numpy in ./anaconda3/lib/python3.7/site-packages (from qcgpu) (1.15.4)
Requirement already satisfied: mako in ./anaconda3/lib/python3.7/site-packages (from qcgpu) (1.0.7)
Collecting pyopencl (from qcgpu)
Using cached https://files.pythonhosted.org/packages/bc/58/3ab1246e94986f1b6953e76d7ea7e69d2dbfef7b3f3874eded48524a024f/pyopencl-2018.2.2.tar.gz
Requirement already satisfied: pybind11 in ./anaconda3/lib/python3.7/site-packages (from qcgpu) (2.2.4)
Requirement already satisfied: MarkupSafe>=0.9.2 in ./anaconda3/lib/python3.7/site-packages (from mako->qcgpu) (1.0)
Requirement already satisfied: pytools>=2017.6 in ./anaconda3/lib/python3.7/site-packages (from pyopencl->qcgpu) (2018.5.2)
Requirement already satisfied: decorator>=3.2.0 in ./anaconda3/lib/python3.7/site-packages (from pyopencl->qcgpu) (4.3.0)
Requirement already satisfied: appdirs>=1.4.0 in ./anaconda3/lib/python3.7/site-packages (from pyopencl->qcgpu) (1.4.3)
Requirement already satisfied: six>=1.9.0 in ./anaconda3/lib/python3.7/site-packages (from pyopencl->qcgpu) (1.11.0)
Building wheels for collected packages: pyopencl
Running setup.py bdist_wheel for pyopencl ... error
Complete output from command /home/conor/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-wf8xbysy/pyopencl/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-misiq730 --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/init.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/cltypes.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/reduction.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/bitonic_sort.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/_cluda.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/bitonic_sort_templates.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/elementwise.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/capture_call.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/clrandom.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/tools.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/algorithm.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/_mymako.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/scan.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/_buffers.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/ipython_ext.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/clmath.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/cache.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/version.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/invoker.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/array.py -> build/lib.linux-x86_64-3.7/pyopencl
creating build/lib.linux-x86_64-3.7/pyopencl/characterize
copying pyopencl/characterize/init.py -> build/lib.linux-x86_64-3.7/pyopencl/characterize
copying pyopencl/characterize/performance.py -> build/lib.linux-x86_64-3.7/pyopencl/characterize
creating build/lib.linux-x86_64-3.7/pyopencl/compyte
copying pyopencl/compyte/init.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte
copying pyopencl/compyte/dtypes.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte
copying pyopencl/compyte/array.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte
creating build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/init.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/setup_opencl.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/test_gpu_ndarray.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/gen_elemwise.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/gen_reduction.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/test_gpu_elemwise.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
running egg_info
writing pyopencl.egg-info/PKG-INFO
writing dependency_links to pyopencl.egg-info/dependency_links.txt
writing requirements to pyopencl.egg-info/requires.txt
writing top-level names to pyopencl.egg-info/top_level.txt
reading manifest file 'pyopencl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.h'
warning: no files found matching 'doc/_static/
.css'
warning: no files found matching 'doc/_templates/.html'
warning: no files found matching '
.py.in'
writing manifest file 'pyopencl.egg-info/SOURCES.txt'
creating build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-airy.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-bessel-j-complex.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-bessel-j.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-bessel-y.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-complex.h -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-eval-tbl.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-hankel-complex.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-ranluxcl.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
creating build/lib.linux-x86_64-3.7/pyopencl/cl/pyopencl-random123
copying pyopencl/cl/pyopencl-random123/array.h -> build/lib.linux-x86_64-3.7/pyopencl/cl/pyopencl-random123
copying pyopencl/cl/pyopencl-random123/openclfeatures.h -> build/lib.linux-x86_64-3.7/pyopencl/cl/pyopencl-random123
copying pyopencl/cl/pyopencl-random123/philox.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl/pyopencl-random123
copying pyopencl/cl/pyopencl-random123/threefry.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl/pyopencl-random123
running build_ext
creating tmp
gcc -pthread -B /home/conor/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -fwrapv -Wall -O3 -DNDEBUG -fPIC -I/home/conor/anaconda3/include/python3.7m -c /tmp/tmp5e430x_u.cpp -o tmp/tmp5e430x_u.o -std=c++14
gcc -pthread -B /home/conor/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -fwrapv -Wall -O3 -DNDEBUG -fPIC -I/home/conor/anaconda3/include/python3.7m -c /tmp/tmpaohswv3o.cpp -o tmp/tmpaohswv3o.o -fvisibility=hidden
building 'pyopencl._cl' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -B /home/conor/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -fwrapv -Wall -O3 -DNDEBUG -fPIC -DPYGPU_PACKAGE=pyopencl -DPYGPU_PYOPENCL=1 -Ipybind11/include -I/home/conor/anaconda3/include/python3.7m -I/home/conor/.local/include/python3.7m -I/home/conor/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/conor/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/conor/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/conor/anaconda3/include/python3.7m -c src/wrap_constants.cpp -o build/temp.linux-x86_64-3.7/src/wrap_constants.o -fvisibility=hidden -DVERSION_INFO="2018.2.2" -std=c++14 -fvisibility=hidden
In file included from src/wrap_constants.cpp:27:0:
src/wrap_cl.hpp:57:10: fatal error: CL/cl.h: No such file or directory
#include <CL/cl.h>
^~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1


Failed building wheel for pyopencl
Running setup.py clean for pyopencl
Failed to build pyopencl
Installing collected packages: pyopencl, qcgpu
Running setup.py install for pyopencl ... error
Complete output from command /home/conor/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-wf8xbysy/pyopencl/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-v1hz2q9c/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/init.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/cltypes.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/reduction.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/bitonic_sort.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/_cluda.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/bitonic_sort_templates.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/elementwise.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/capture_call.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/clrandom.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/tools.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/algorithm.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/_mymako.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/scan.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/_buffers.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/ipython_ext.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/clmath.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/cache.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/version.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/invoker.py -> build/lib.linux-x86_64-3.7/pyopencl
copying pyopencl/array.py -> build/lib.linux-x86_64-3.7/pyopencl
creating build/lib.linux-x86_64-3.7/pyopencl/characterize
copying pyopencl/characterize/init.py -> build/lib.linux-x86_64-3.7/pyopencl/characterize
copying pyopencl/characterize/performance.py -> build/lib.linux-x86_64-3.7/pyopencl/characterize
creating build/lib.linux-x86_64-3.7/pyopencl/compyte
copying pyopencl/compyte/init.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte
copying pyopencl/compyte/dtypes.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte
copying pyopencl/compyte/array.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte
creating build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/init.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/setup_opencl.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/test_gpu_ndarray.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/gen_elemwise.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/gen_reduction.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
copying pyopencl/compyte/ndarray/test_gpu_elemwise.py -> build/lib.linux-x86_64-3.7/pyopencl/compyte/ndarray
running egg_info
writing pyopencl.egg-info/PKG-INFO
writing dependency_links to pyopencl.egg-info/dependency_links.txt
writing requirements to pyopencl.egg-info/requires.txt
writing top-level names to pyopencl.egg-info/top_level.txt
reading manifest file 'pyopencl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.h'
warning: no files found matching 'doc/_static/
.css'
warning: no files found matching 'doc/_templates/.html'
warning: no files found matching '
.py.in'
writing manifest file 'pyopencl.egg-info/SOURCES.txt'
creating build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-airy.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-bessel-j-complex.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-bessel-j.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-bessel-y.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-complex.h -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-eval-tbl.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-hankel-complex.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
copying pyopencl/cl/pyopencl-ranluxcl.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl
creating build/lib.linux-x86_64-3.7/pyopencl/cl/pyopencl-random123
copying pyopencl/cl/pyopencl-random123/array.h -> build/lib.linux-x86_64-3.7/pyopencl/cl/pyopencl-random123
copying pyopencl/cl/pyopencl-random123/openclfeatures.h -> build/lib.linux-x86_64-3.7/pyopencl/cl/pyopencl-random123
copying pyopencl/cl/pyopencl-random123/philox.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl/pyopencl-random123
copying pyopencl/cl/pyopencl-random123/threefry.cl -> build/lib.linux-x86_64-3.7/pyopencl/cl/pyopencl-random123
running build_ext
gcc -pthread -B /home/conor/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -fwrapv -Wall -O3 -DNDEBUG -fPIC -I/home/conor/anaconda3/include/python3.7m -c /tmp/tmp_uneib6t.cpp -o tmp/tmp_uneib6t.o -std=c++14
gcc -pthread -B /home/conor/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -fwrapv -Wall -O3 -DNDEBUG -fPIC -I/home/conor/anaconda3/include/python3.7m -c /tmp/tmp3aeuupkf.cpp -o tmp/tmp3aeuupkf.o -fvisibility=hidden
building 'pyopencl._cl' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -B /home/conor/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -fwrapv -Wall -O3 -DNDEBUG -fPIC -DPYGPU_PACKAGE=pyopencl -DPYGPU_PYOPENCL=1 -Ipybind11/include -I/home/conor/anaconda3/include/python3.7m -I/home/conor/.local/include/python3.7m -I/home/conor/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/conor/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/conor/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/conor/anaconda3/include/python3.7m -c src/wrap_constants.cpp -o build/temp.linux-x86_64-3.7/src/wrap_constants.o -fvisibility=hidden -DVERSION_INFO="2018.2.2" -std=c++14 -fvisibility=hidden
In file included from src/wrap_constants.cpp:27:0:
src/wrap_cl.hpp:57:10: fatal error: CL/cl.h: No such file or directory
#include <CL/cl.h>
^~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/home/conor/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-wf8xbysy/pyopencl/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-v1hz2q9c/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-wf8xbysy/pyopencl/

Hi, I am not clear with the steps to run the benchmarks. Could you please help me with elaborated sequence of steps to be followed to run this test. My setup details are : cpu: AMD FX 4100 quad core:: gpu: Ellesmere

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. rustc 1.26.0-nightly):
  • Operating System and version:
  • Hardware (e.g. CPU: Intel i5-6360U, GPU: Intel Iris Graphics 540, 8GB RAM)

Panic when calling State::new()

I attempted to compile and run a short example program using qcgpu-rust and received the following panic when creating a new state. I don't have any experience using OpenCL, so I'm unsure whether my particular OpenCL configuration is causing this or not.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Kernel argument type mismatch. The argument named: 'target' at index: [1] should be a 'uint' (ArgType { base_type: Uint, cardinality: One, is_ptr: false }).', libcore/result.rs:945:5                                                                                                
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:475
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: rust_begin_unwind
             at libstd/panicking.rs:325
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   8: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:26
   9: <core::result::Result<T, E>>::unwrap
             at /checkout/src/libcore/result.rs:782
  10: qcgpu::state::State::new
             at /home/******/.cargo/registry/src/github.com-1ecc6299db9ec823/qcgpu-0.1.0/src/state.rs:60
  11: qcgpu_test::main
             at src/main.rs:5
  12: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  13: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  14: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:106
  15: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  16: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  17: main
  18: __libc_start_main
  19: _start

For reference, the sample program:

extern crate qcgpu;
use qcgpu::State;

fn main() {
    let mut state = State::new(2,0);
    state.x(0);

    println!("Measured: {}", state.measure());
}

And here's the output of clinfo:

Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.0 AMD-APP (1800.11)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback cl_amd_offline_devices 
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 1
  Device Name                                     Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
  Device Vendor                                   GenuineIntel
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.2 AMD-APP (1800.11)
  Driver Version                                  1800.11 (sse2,avx)
  Device OpenCL C Version                         OpenCL C 1.2 
  Device Type                                     CPU
  Device Board Name (AMD)                         
  Device Topology (AMD)                           (n/a)
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               4
  Max clock frequency                             1403MHz
  Device Partition                                (core, cl_ext_device_fission)
    Max number of sub-devices                     4
    Supported partition types                     equally, by counts, by affinity domain
    Supported affinity domains                    L3 cache, L2 cache, L1 cache, next partitionable
    Supported partition types (ext)               equally, by counts, by affinity domain
    Supported affinity domains (ext)              L3 cache, L2 cache, L1 cache, next fissionable
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             1024
  Preferred work group size multiple              1
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 4 / 4        (n/a)
    float                                                8 / 8       
    double                                               4 / 4        (cl_khr_fp64)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  Yes
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              16776560640 (15.62GiB)
  Error Correction support                        No
  Max memory allocation                           4194140160 (3.906GiB)
  Unified memory for Host and Device              Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        32768 (32KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             16
    Max size for 1D images from buffer            65536 pixels
    Max 1D or 2D image array size                 2048 images
    Max 2D image size                             8192x8192 pixels
    Max 3D image size                             2048x2048x2048 pixels
    Max number of read image args                 128
    Max number of write image args                64
  Local memory type                               Global
  Local memory size                               32768 (32KiB)
  Max number of constant args                     8
  Max constant buffer size                        65536 (64KiB)
  Max size of kernel argument                     4096 (4KiB)
  Queue properties                                
    Out-of-order execution                        No
    Profiling                                     Yes
  Prefer user sync for interop                    Yes
  Profiling timer resolution                      1ns
  Profiling timer offset since Epoch (AMD)        1530994088516357846ns (Sat Jul  7 15:08:08 2018)
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            Yes
    SPIR versions                                 1.2
  printf() buffer size                            65536 (64KiB)
  Built-in kernels                                
  Device Extensions                               cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_device_fission cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_spir cl_khr_gl_event 

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  AMD Accelerated Parallel Processing
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [AMD]
  clCreateContext(NULL, ...) [default]            Success [AMD]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.12
  ICD loader Profile                              OpenCL 2.2

Bell state bitstring is off by one

This is really amazing work! I noticed something weird: when I run a two qubit bell state and sample it I see elements "00" and "100".

Expected Behavior

Expected would be: "00" and "11" like in this example: https://qcgpu.github.io/qcgpu-rust/book/user-guide/examples.html

Current Behavior

Currently returns: Measured: {"00": 487, "100": 513}

Steps to Reproduce (for bugs)

extern crate qcgpu;

use qcgpu::State;

fn main() {
    let num_gates = 2;
    let mut state = State::new(num_gates, 0);

    state.h(0);
    for i in 0..num_gates as i32 {
        state.cx(i, i + 1);
    }

    println!("Measured: {:?}", state.measure_many(1000));
}

Your Environment

  • rustc 1.25.0 (84203cac6 2018-03-25)
  • qcgpu-rust on latest master

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.