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
c854a4e1
Commit
c854a4e1
authored
Feb 13, 2019
by
Mccaskey, Alex
Browse files
Merge branch 'master' of
https://github.com/eclipse/xacc
parents
a23b5ef6
b5fa7494
Changes
3
Hide whitespace changes
Inline
Side-by-side
docker/jupyter-lab/Dockerfile
View file @
c854a4e1
...
...
@@ -5,8 +5,8 @@ run rm /bin/sh && ln -s /bin/bash /bin/sh && apt-get -y update && apt-get -y ins
run
python3
-m
pip
install
--upgrade
pip
&&
python3
-m
pip
install
--user
jupyterlab pyquil mpmath deepdiff prompt-toolkit
==
1.0.15 dwave-qbsolv dwave-ocean-sdk
\
numpy scipy openfermion
--no-cache-dir
&&
ipython3 kernel
install
\
&&
python3
-m
pip uninstall
-y
h5py
&&
python3
-m
pip
install
h5py
==
2.8.0rc1
\
&&
apt-get
install
-y
apt-transport-https ca-certificates curl software-properties-common
\
&&
python3
-m
pip uninstall
-y
h5py
&&
python3
-m
pip
install
h5py
==
2.8.0rc1
run
apt-get update
&&
apt-get
install
-y
apt-transport-https ca-certificates curl software-properties-common
\
&&
curl
-fsSL
https://download.docker.com/linux/ubuntu/gpg | apt-key add -
\
&&
add-apt-repository
"deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic test"
\
&&
apt-get update
-y
&&
apt-get
install
-y
docker-ce
\
...
...
@@ -32,5 +32,4 @@ run git clone --recursive https://github.com/eclipse/xacc && cd xacc && mkdir bu
&&
rm
-rf
xacc/build xacc-rigetti/build tnqvm/build xacc-ibm/build xacc-projectq/build xacc-vqe/build xacc-vqe-bayesopt/build
\
xacc-vqe-fcidump/build
run
echo
"alias python=python3"
>>
~/.bashrc
\
&&
echo
"function xacc-logs() { docker logs -f
\$
(docker ps -aqf name=qchem) ; }"
>>
~/.bashrc
run
python3
-m
pip
install
ipopo
&&
echo
"alias python=python3"
>>
~/.bashrc
docker/jupyter-lab/docker-compose.yml
View file @
c854a4e1
...
...
@@ -3,7 +3,7 @@ version: '2'
services
:
xacc-jupyter-lab
:
image
:
xacc/jupyter
-lab
image
:
xacc/jupyter
command
:
"
bash
-c
'PATH=$PATH:/root/.local/bin
SHELL=/bin/bash
jupyter
lab
--no-browser
--ip=0.0.0.0
--port=9000
--allow-root
--notebook-dir=/projects
--NotebookApp.token=
\"\"
'"
volumes
:
-
../:/projects
...
...
quantum/gate/compiler/CircuitOptimizer.cpp
View file @
c854a4e1
...
...
@@ -49,14 +49,14 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) {
auto
inst
=
gateFunction
->
getInstruction
(
i
);
if
(
isRotation
(
inst
->
name
()))
{
auto
param
=
inst
->
getParameter
(
0
);
double
val
=
ipToDouble
(
param
);
if
(
std
::
fabs
(
val
)
<
1e-12
)
{
inst
->
disable
();
if
(
!
param
.
isVariable
())
{
double
val
=
ipToDouble
(
param
);
if
(
std
::
fabs
(
val
)
<
1e-12
)
{
inst
->
disable
();
}
}
}
}
// Remove all CNOT(p,q) CNOT(p,q) Pairs
while
(
true
)
{
bool
modified
=
false
;
...
...
@@ -78,7 +78,6 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) {
}
}
}
if
(
!
modified
)
break
;
}
...
...
@@ -94,7 +93,6 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) {
auto
adj
=
graphView
.
getNeighborList
(
node
.
id
());
std
::
vector
<
int
>
nAsVec
(
adj
.
begin
(),
adj
.
end
());
if
(
adj
.
size
()
==
1
)
{
auto
nextNode
=
graphView
.
getVertex
(
nAsVec
[
0
]);
if
(
node
.
name
()
==
"H"
&&
nextNode
.
name
()
==
"H"
)
{
...
...
@@ -125,7 +123,6 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) {
}
}
}
return
ir
;
}
...
...
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