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
255e2104
Commit
255e2104
authored
Jan 23, 2019
by
Mccaskey, Alex
Browse files
adding xacc.dwave.create*() python api functions
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
4a89d030
Pipeline
#30285
passed with stages
in 8 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
python/xacc-py.cpp
View file @
255e2104
...
...
@@ -602,4 +602,36 @@ PYBIND11_MODULE(_pyxacc, m) {
},
"Compute and return the state after execution of the given program on "
"the given accelerator."
);
py
::
module
aqcsub
=
m
.
def_submodule
(
"dwave"
,
"Gate model quantum computing data structures."
);
aqcsub
.
def
(
"create"
,
[](
const
std
::
string
&
name
,
std
::
vector
<
int
>
qbits
,
std
::
vector
<
InstructionParameter
>
params
=
std
::
vector
<
InstructionParameter
>
{})
->
std
::
shared_ptr
<
Instruction
>
{
return
xacc
::
getService
<
IRProvider
>
(
"dwave"
)
->
createInstruction
(
name
,
qbits
,
params
);
},
"Convenience function for creating a new DWInstruction."
,
py
::
arg
(
"name"
),
py
::
arg
(
"qbits"
),
py
::
arg
(
"params"
)
=
std
::
vector
<
InstructionParameter
>
{});
aqcsub
.
def
(
"createFunction"
,
[](
const
std
::
string
&
name
,
std
::
vector
<
int
>
qbits
,
std
::
vector
<
InstructionParameter
>
params
=
std
::
vector
<
InstructionParameter
>
{})
->
std
::
shared_ptr
<
Function
>
{
return
xacc
::
getService
<
IRProvider
>
(
"dwave"
)
->
createFunction
(
name
,
qbits
,
params
);
},
"Convenience function for creating a new DWFunction."
,
py
::
arg
(
"name"
),
py
::
arg
(
"qbits"
),
py
::
arg
(
"params"
)
=
std
::
vector
<
InstructionParameter
>
{});
aqcsub
.
def
(
"createIR"
,
[]()
->
std
::
shared_ptr
<
IR
>
{
return
xacc
::
getService
<
IRProvider
>
(
"dwave"
)
->
createIR
();
},
"Convenience function for creating a new DWIR."
);
}
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