Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xacc
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ORNL Quantum Computing Institute
xacc
Commits
8f357a5f
Commit
8f357a5f
authored
8 years ago
by
Mccaskey, Alex
Browse files
Options
Downloads
Patches
Plain Diff
fixed a bug, minor clean up
parent
6334aec0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/quantum/gate/teleport_scaffold.cpp
+1
-1
1 addition, 1 deletion
examples/quantum/gate/teleport_scaffold.cpp
quantum/gate/accelerators/eigenaccelerator/EigenAccelerator.hpp
+5
-3
5 additions, 3 deletions
...m/gate/accelerators/eigenaccelerator/EigenAccelerator.hpp
with
6 additions
and
4 deletions
examples/quantum/gate/teleport_scaffold.cpp
+
1
−
1
View file @
8f357a5f
...
...
@@ -42,8 +42,8 @@ const std::string src("__qpu__ teleport () {\n"
"
H
(
qreg
[
0
]);
\
n
"
"
creg
[
0
]
=
MeasZ
(
qreg
[
0
]);
\
n
"
"
creg
[
1
]
=
MeasZ
(
qreg
[
1
]);
\
n
"
"
if
(
creg
[
0
]
==
1
)
Z
(
qreg
[
2
]);
\
n
"
"
if
(
creg
[
1
]
==
1
)
X
(
qreg
[
2
]);
\
n
"
"
if
(
creg
[
0
]
==
1
)
Z
(
qreg
[
2
]);
\
n
"
"
}
\
n
");
int main (int argc, char** argv) {
...
...
This diff is collapsed.
Click to expand it.
quantum/gate/accelerators/eigenaccelerator/EigenAccelerator.hpp
+
5
−
3
View file @
8f357a5f
...
...
@@ -55,19 +55,21 @@ public:
* The constructor, create tensor gates
*/
EigenAccelerator
()
{
Eigen
::
MatrixXcd
h
(
2
,
2
),
cnot
(
4
,
4
),
I
(
2
,
2
),
x
(
2
,
2
),
p0
(
2
,
2
),
p1
(
2
,
2
);
Eigen
::
MatrixXcd
h
(
2
,
2
),
cnot
(
4
,
4
),
I
(
2
,
2
),
x
(
2
,
2
),
p0
(
2
,
2
),
p1
(
2
,
2
)
,
z
(
2
,
2
)
;
h
<<
1.0
/
sqrt2
,
1.0
/
sqrt2
,
1.0
/
sqrt2
,
-
1.0
/
sqrt2
;
cnot
<<
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
1
,
0
;
x
<<
0
,
1
,
1
,
0
;
I
<<
1
,
0
,
0
,
1
;
p0
<<
1
,
0
,
0
,
0
;
p1
<<
0
,
0
,
0
,
1
;
z
<<
1
,
0
,
0
,
-
1
;
gates
.
insert
(
std
::
map
<
std
::
string
,
Eigen
::
MatrixXcd
>::
value_type
(
"h"
,
h
));
gates
.
insert
(
std
::
map
<
std
::
string
,
Eigen
::
MatrixXcd
>::
value_type
(
"cnot"
,
cnot
));
gates
.
insert
(
std
::
map
<
std
::
string
,
Eigen
::
MatrixXcd
>::
value_type
(
"I"
,
I
));
gates
.
insert
(
std
::
map
<
std
::
string
,
Eigen
::
MatrixXcd
>::
value_type
(
"x"
,
x
));
gates
.
insert
(
std
::
map
<
std
::
string
,
Eigen
::
MatrixXcd
>::
value_type
(
"p0"
,
p0
));
gates
.
insert
(
std
::
map
<
std
::
string
,
Eigen
::
MatrixXcd
>::
value_type
(
"p1"
,
p1
));
gates
.
insert
(
std
::
map
<
std
::
string
,
Eigen
::
MatrixXcd
>::
value_type
(
"z"
,
z
));
}
/**
...
...
@@ -142,11 +144,11 @@ public:
// set their enabled state to true
for
(
int
i
=
currentNodeId
+
1
;
i
<
nNodes
;
i
++
)
{
// Once we hit the next final state node, then break out
if
(
graph
.
getVertexProperty
<
0
>
(
i
)
==
"FinalState"
)
{
if
(
std
::
get
<
0
>
(
gateOperations
[
i
].
properties
)
==
"FinalState"
)
{
break
;
}
std
::
cout
<<
"Enabling "
<<
graph
.
getVertexProperty
<
0
>
(
i
)
<<
"
\n
"
;
graph
.
setVertexProperty
<
4
>
(
i
,
true
)
;
std
::
get
<
4
>
(
gateOperations
[
i
].
properties
)
=
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment