Commit c854a4e1 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

Merge branch 'master' of https://github.com/eclipse/xacc

parents a23b5ef6 b5fa7494
...@@ -5,8 +5,8 @@ run rm /bin/sh && ln -s /bin/bash /bin/sh && apt-get -y update && apt-get -y ins ...@@ -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 \ 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 \ numpy scipy openfermion --no-cache-dir && ipython3 kernel install \
&& python3 -m pip uninstall -y h5py && python3 -m pip install h5py==2.8.0rc1 \ && 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 \ 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 - \ && 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" \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic test" \
&& apt-get update -y && apt-get install -y docker-ce \ && 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 ...@@ -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 \ && 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 xacc-vqe-fcidump/build
run echo "alias python=python3" >> ~/.bashrc \ run python3 -m pip install ipopo && echo "alias python=python3" >> ~/.bashrc
&& echo "function xacc-logs() { docker logs -f \$(docker ps -aqf name=qchem) ; }" >> ~/.bashrc
...@@ -3,7 +3,7 @@ version: '2' ...@@ -3,7 +3,7 @@ version: '2'
services: services:
xacc-jupyter-lab: 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=\"\"'" 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: volumes:
- ../:/projects - ../:/projects
......
...@@ -49,14 +49,14 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) { ...@@ -49,14 +49,14 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) {
auto inst = gateFunction->getInstruction(i); auto inst = gateFunction->getInstruction(i);
if (isRotation(inst->name())) { if (isRotation(inst->name())) {
auto param = inst->getParameter(0); auto param = inst->getParameter(0);
double val = ipToDouble(param); if (!param.isVariable()) {
double val = ipToDouble(param);
if (std::fabs(val) < 1e-12) { if (std::fabs(val) < 1e-12) {
inst->disable(); inst->disable();
}
} }
} }
} }
// Remove all CNOT(p,q) CNOT(p,q) Pairs // Remove all CNOT(p,q) CNOT(p,q) Pairs
while (true) { while (true) {
bool modified = false; bool modified = false;
...@@ -78,7 +78,6 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) { ...@@ -78,7 +78,6 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) {
} }
} }
} }
if (!modified) if (!modified)
break; break;
} }
...@@ -94,7 +93,6 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) { ...@@ -94,7 +93,6 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) {
auto adj = graphView.getNeighborList(node.id()); auto adj = graphView.getNeighborList(node.id());
std::vector<int> nAsVec(adj.begin(), adj.end()); std::vector<int> nAsVec(adj.begin(), adj.end());
if (adj.size() == 1) { if (adj.size() == 1) {
auto nextNode = graphView.getVertex(nAsVec[0]); auto nextNode = graphView.getVertex(nAsVec[0]);
if (node.name() == "H" && nextNode.name() == "H") { if (node.name() == "H" && nextNode.name() == "H") {
...@@ -125,7 +123,6 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) { ...@@ -125,7 +123,6 @@ std::shared_ptr<IR> CircuitOptimizer::transform(std::shared_ptr<IR> ir) {
} }
} }
} }
return ir; return ir;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment