Skip to content

Commit

Permalink
Move AlphaFeats to Main and restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
jotterbach committed Oct 11, 2017
1 parent 291fda5 commit 107f284
Show file tree
Hide file tree
Showing 37 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docs/bernstein_vazirani.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Here you can find documentation for the different submodules in bernstein_vazira
grove.bernstein_vazirani.bernstein_vazirani
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: grove.alpha.bernstein_vazirani.bernstein_vazirani
.. automodule:: grove.bernstein_vazirani.bernstein_vazirani
:members:
:undoc-members:
:show-inheritance:
Expand Down
2 changes: 1 addition & 1 deletion docs/simon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Here you can find documentation for the different submodules in simon.
grove.simon.simon
~~~~~~~~~~~~~~~~~

.. automodule:: grove.alpha.simon.simon
.. automodule:: grove.simon.simon
:members:
:undoc-members:
:show-inheritance:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
<https://arxiv.org/abs/quant-ph/0005055 arXiv:quant-ph/0005055>`_ for more information.
"""
import numpy as np

import pyquil.quil as pq
from pyquil.gates import H, X, Z, RZ, STANDARD_GATES

from grove.alpha.utility_programs import ControlledProgramBuilder
from grove.utils.utility_programs import ControlledProgramBuilder

STANDARD_GATE_NAMES = list(STANDARD_GATES.keys())
X_GATE = np.array([[0, 1], [1, 0]])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
"""

import numpy as np

import pyquil.quil as pq
from pyquil.gates import H
from pyquil.quilbase import Qubit

from grove.alpha.amplification.amplification import amplification_circuit
from grove.amplification.amplification import amplification_circuit


class Grover(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import pyquil.quil as pq
from pyquil.gates import X, Z

from grove.alpha.utility_programs import ControlledProgramBuilder
from grove.utils.utility_programs import ControlledProgramBuilder


def basis_selector_oracle(qubits, bitstring):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import pyquil.quil as pq
from pyquil.gates import H, X

from grove.alpha.bernstein_vazirani import utils
from grove.bernstein_vazirani import utils


def create_bv_bitmap(dot_product_vector, dot_product_bias):
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion grove/alpha/simon/simon.py → grove/simon/simon.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import pyquil.quil as pq
from pyquil.gates import H

import grove.alpha.simon.utils as utils
import grove.simon.utils as utils


def create_1to1_bitmap(mask):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import pyquil.quil as pq
from pyquil.gates import X, H, RZ, CZ

from grove.alpha.amplification.amplification import amplification_circuit, diffusion_program
from grove.alpha.tests.utils_for_testing import prog_equality
from grove.amplification.amplification import amplification_circuit, diffusion_program
from grove.tests.utils.utils_for_testing import prog_equality

triple_hadamard = pq.Program().inst(H(0)).inst(H(1)).inst(H(2))
cz_gate = pq.Program(CZ(0, 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from pyquil.gates import X, Z, H
from pyquil.quil import Program

from grove.alpha.amplification.grover import Grover
from grove.alpha.tests.utils_for_testing import prog_equality, synthesize_programs
from grove.amplification.grover import Grover
from grove.tests.utils.utils_for_testing import prog_equality, synthesize_programs

identity_oracle = Program()
"""Does nothing on all inputs."""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import pytest

from pyquil.quil import Program

from grove.alpha.amplification.oracles import basis_selector_oracle
from grove.amplification.oracles import basis_selector_oracle


def test_basis_selector_oracle():
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from mock import patch
import numpy as np
from mock import patch

from grove.alpha.bernstein_vazirani.bernstein_vazirani import BernsteinVazirani, create_bv_bitmap
from grove.bernstein_vazirani.bernstein_vazirani import BernsteinVazirani, create_bv_bitmap


def test_bv_bitmap_generator():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from grove.alpha.bernstein_vazirani import utils as u
from grove.bernstein_vazirani import utils as u


def test_bitwise_dot_product():
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added grove/tests/pyvqe/__init__.py
Empty file.
File renamed without changes.
Empty file added grove/tests/qft/__init__.py
Empty file.
File renamed without changes.
Empty file added grove/tests/simon/__init__.py
Empty file.
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
"""Test class for helper methods found simon"""

from os.path import abspath, dirname

import numpy as np
from grove.alpha.simon.simon import Simon, create_1to1_bitmap, create_valid_2to1_bitmap
from mock import patch
from pyquil.quil import Program

from os.path import abspath, dirname
from mock import patch
from grove.simon.simon import Simon, create_1to1_bitmap, create_valid_2to1_bitmap

package_path = abspath(dirname(dirname(__file__)))

EXPECTED_SIMON_ORACLE = np.load(package_path + '/tests/data/simon_test_oracle.npy')
EXPECTED_SIMON_ORACLE = np.load(package_path + '/simon/data/simon_test_oracle.npy')


def _create_expected_program():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from grove.alpha.simon import utils as u
from grove.simon import utils as u


def test_unitary_two_by_two():
Expand Down
Empty file added grove/tests/utils/__init__.py
Empty file.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
from pyquil.quil import Program

from grove.alpha.tests.utils_for_testing import non_action_insts, prog_len
from grove.alpha.utility_programs import ControlledProgramBuilder
from grove.tests.utils.utils_for_testing import non_action_insts, prog_len
from grove.utils.utility_programs import ControlledProgramBuilder

SIGMA_Z = np.array([[1, 0], [0, -1]])

Expand Down
File renamed without changes.
Empty file added grove/utils/__init__.py
Empty file.
File renamed without changes.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
"grove.pyqaoa",
"grove.pyvqe",
"grove.qft",
"grove.bernstein_vazirani",
"grove.simon",
"grove.amplification",
"grove.alpha",
"grove.alpha.phaseestimation",
"grove.alpha.deutsch_jozsa",
"grove.alpha.arbitrary_state",
"grove.alpha.bernstein_vazirani",
"grove.alpha.simon",
"grove.alpha.amplification",
"grove.alpha.fermion_transforms"
],
install_requires=[
Expand Down

0 comments on commit 107f284

Please sign in to comment.