Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
1d8fc6de
Commit
1d8fc6de
authored
Aug 14, 2018
by
Mccaskey, Alex
Browse files
removing dependence of pyxacc on xacc-quantum-gate
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
22694146
Changes
2
Hide whitespace changes
Inline
Side-by-side
python/CMakeLists.txt
View file @
1d8fc6de
...
...
@@ -29,7 +29,7 @@ add_library(_pyxacc SHARED xacc-py.cpp)
set_target_properties
(
_pyxacc PROPERTIES PREFIX
""
)
target_link_libraries
(
_pyxacc PUBLIC CppMicroServices xacc
xacc-quantum-gate
)
target_link_libraries
(
_pyxacc PUBLIC CppMicroServices xacc
)
if
(
APPLE
)
set_target_properties
(
_pyxacc PROPERTIES INSTALL_RPATH
"@loader_path/lib"
)
...
...
python/xacc-py.cpp
View file @
1d8fc6de
...
...
@@ -12,6 +12,8 @@
*******************************************************************************/
#include
"XACC.hpp"
#include
"IRGenerator.hpp"
#include
"IRProvider.hpp"
#include
"InstructionIterator.hpp"
#include
<pybind11/complex.h>
#include
<pybind11/numpy.h>
...
...
@@ -21,13 +23,8 @@
#include
<pybind11/iostream.h>
#include
<pybind11/operators.h>
#include
"GateInstruction.hpp"
#include
"GateFunction.hpp"
#include
"GateIR.hpp"
namespace
py
=
pybind11
;
using
namespace
xacc
;
using
namespace
xacc
::
quantum
;
// `boost::variant` as an example -- can be any `std::variant`-like container
namespace
pybind11
{
namespace
detail
{
...
...
@@ -54,15 +51,15 @@ public:
}
const
std
::
string
description
()
const
override
{
return
""
;
//PYBIND11_OVERLOAD_PURE(const std::string, xacc::Accelerator, description);
return
""
;
}
void
initialize
()
override
{
return
;
//PYBIND11_OVERLOAD_PURE(void, xacc::Accelerator, initialize);
return
;
}
AcceleratorType
getType
()
override
{
return
Accelerator
::
AcceleratorType
::
qpu_gate
;
//PYBIND11_OVERLOAD_PURE(AcceleratorType, xacc::Accelerator, getType);
return
Accelerator
::
AcceleratorType
::
qpu_gate
;
}
std
::
vector
<
std
::
shared_ptr
<
IRTransformation
>>
getIRTransformations
()
override
{
...
...
@@ -73,13 +70,7 @@ public:
/* Trampoline (need one for each virtual function) */
void
execute
(
std
::
shared_ptr
<
xacc
::
AcceleratorBuffer
>
buf
,
std
::
shared_ptr
<
xacc
::
Function
>
f
)
override
{
PYBIND11_OVERLOAD_PURE
(
void
,
/* Return type */
xacc
::
Accelerator
,
/* Parent class */
execute
,
/* Name of function in C++ (must match Python name) */
buf
,
f
);
PYBIND11_OVERLOAD_PURE
(
void
,
xacc
::
Accelerator
,
execute
,
buf
,
f
);
}
std
::
vector
<
std
::
shared_ptr
<
AcceleratorBuffer
>>
execute
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment