Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
fdc6af69
Commit
fdc6af69
authored
Jun 11, 2019
by
Mccaskey, Alex
Browse files
minor updates to get qcs running
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
1732d3c4
Pipeline
#59196
failed with stages
in 24 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
quantum/plugins/rigetti/qcs/QCSAccelerator.cpp
View file @
fdc6af69
...
...
@@ -50,7 +50,7 @@ std::shared_ptr<IR> MapToPhysical::transform(std::shared_ptr<IR> ir) {
physical2Logical
[
edge
.
second
]);
}
hardwareGraph
->
write
(
std
::
cout
);
//
hardwareGraph->write(std::cout);
for
(
auto
&
function
:
ir
->
getKernels
())
{
auto
logicalGraph
=
function
->
toGraph
();
InstructionIterator
it
(
function
);
...
...
@@ -64,7 +64,6 @@ std::shared_ptr<IR> MapToPhysical::transform(std::shared_ptr<IR> ir) {
probEdges
.
push_back
({
nextInst
->
bits
()[
0
],
nextInst
->
bits
()[
1
]});
nUniqueProbBits
.
insert
(
nextInst
->
bits
()[
0
]);
nUniqueProbBits
.
insert
(
nextInst
->
bits
()[
1
]);
}
}
...
...
@@ -80,8 +79,8 @@ std::shared_ptr<IR> MapToPhysical::transform(std::shared_ptr<IR> ir) {
problemGraph
->
addEdge
(
inst
.
first
,
inst
.
second
,
1.0
);
}
std
::
cout
<<
"
\n
"
;
problemGraph
->
write
(
std
::
cout
);
//
std::cout << "\n";
//
problemGraph->write(std::cout);
// Compute the minor graph embedding
auto
embedding
=
embeddingAlgorithm
->
embed
(
problemGraph
,
hardwareGraph
);
...
...
quantum/plugins/rigetti/qcs/QCSAccelerator.hpp
View file @
fdc6af69
...
...
@@ -36,6 +36,7 @@
#include "CLIParser.hpp"
#include "RemoteAccelerator.hpp"
#include <dlfcn.h>
#define RAPIDJSON_HAS_STDSTRING 1
#include "rapidjson/prettywriter.h"
...
...
@@ -93,6 +94,7 @@ public:
const
std
::
vector
<
std
::
shared_ptr
<
Function
>>
functions
)
override
;
virtual
void
initialize
()
{
void
*
const
libpython_handle
=
dlopen
(
"libpython3.6m.so"
,
RTLD_LAZY
|
RTLD_GLOBAL
);
if
(
xacc
::
optionExists
(
"qcs-backend"
))
{
auto
backend
=
xacc
::
getOption
(
"qcs-backend"
);
...
...
@@ -109,7 +111,6 @@ public:
}
for
(
auto
itr
=
twoq
.
MemberBegin
();
itr
!=
twoq
.
MemberEnd
();
++
itr
)
{
auto
connStr
=
itr
->
name
.
GetString
();
std
::
cout
<<
"CONN : "
<<
connStr
<<
"
\n
"
;
auto
split
=
xacc
::
split
(
connStr
,
'-'
);
latticeEdges
.
push_back
({
std
::
stoi
(
split
[
0
]),
std
::
stoi
(
split
[
1
])});
}
...
...
xacc/XACC.cpp
View file @
fdc6af69
...
...
@@ -177,7 +177,14 @@ std::shared_ptr<Accelerator> getAccelerator() {
"requires that you set --accelerator at the command line."
);
}
auto
acc
=
xacc
::
getService
<
Accelerator
>
(
getOption
(
"accelerator"
));
auto
name
=
getOption
(
"accelerator"
);
auto
name_backend
=
split
(
name
,
':'
);
if
(
name_backend
.
size
()
>
1
)
{
setOption
(
name_backend
[
0
]
+
"-backend"
,
name_backend
[
1
]);
}
auto
acc
=
xacc
::
getService
<
Accelerator
>
(
name_backend
[
0
]);
if
(
acc
)
{
acc
->
initialize
();
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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