Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making VQE tests lighter #1144

Merged
merged 6 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,152 changes: 425 additions & 727 deletions poetry.lock

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ ply = "^3.11"
scikit-learn = "^1.2.1"
dill = "^0.3.6"
pytest-cov = "^4.0.0"
pylint = "^2.16.2"
pylint = "^3.0.3"
matplotlib = "^3.7.0"
qibojit = { git = "https://github.com/qiboteam/qibojit.git" }
tensorflow = { version = "^2.12.0", markers = "sys_platform == 'linux' or sys_platform == 'darwin'" }
# TODO: the marker is a temporary solution due to the lack of the tensorflow-io 0.32.0's wheels for Windows, this package is one of
# the tensorflow requirements
tensorflow = { version = "^2.15.0", markers = "sys_platform == 'linux'" }

[tool.poe.tasks]
test = "pytest"
lint = "pylint src --errors-only"
Expand All @@ -74,7 +73,6 @@ docs = "make -C doc html"
docs-clean = "make -C doc clean"
test-docs = "make -C doc doctest"


[tool.poetry.group.cuda11]
optional = true

Expand All @@ -83,7 +81,6 @@ cupy-cuda11x = "^12.0.0"
cuquantum-python-cu11 = "^23.3.0"
qibojit = { git = "https://github.com/qiboteam/qibojit.git" }


[tool.poetry.group.cuda12]
optional = true

Expand Down
8 changes: 6 additions & 2 deletions src/qibo/models/qgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ def define_cost_gan(
y_fake = np.ones((samples, 1))
# evaluate discriminator on fake examples
disc_output = discriminator(x_fake)
loss = tf.keras.losses.binary_crossentropy(y_fake, disc_output)
loss = tf.keras.losses.binary_crossentropy( # pylint: disable=no-member
y_fake, disc_output
)
loss = tf.reduce_mean(loss)
return loss

Expand Down Expand Up @@ -264,7 +266,9 @@ def generate_real_samples(samples, distribution, real_samples):
np.random.uniform(-0.15, 0.15, n), dtype=tf.complex128
)

optimizer = tf.optimizers.Adadelta(learning_rate=self.lr)
optimizer = tf.optimizers.Adadelta( # pylint: disable=no-member
learning_rate=self.lr
)
# prepare real samples
s = self.reference
# manually enumerate epochs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
4.245052807528133798e-03
1.034267702652136951e-07
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
Expand All @@ -96,7 +96,7 @@
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
-5.791965300232200242e-01
-1.125407363285722828e-08
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
Expand Down Expand Up @@ -138,7 +138,7 @@
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
-5.499171963820416176e-01
8.175715411600245706e-04
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
Expand All @@ -159,7 +159,7 @@
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
7.071736736785135848e-03
-5.513468058776938713e-05
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
Expand Down Expand Up @@ -264,14 +264,14 @@
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
2.041207767216807190e-03
7.347588697741100523e-03
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
3.910005916046373486e-01
-1.097722566296985974e-01
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
1.038491867108072564e-02
1.142305492602130386e-08
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
Expand All @@ -96,7 +96,7 @@
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
3.314560044007878736e-01
1.018967776766042943e-07
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
Expand Down Expand Up @@ -138,7 +138,7 @@
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
3.147784053399704796e-01
-7.402466722830055267e-03
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
Expand All @@ -159,7 +159,7 @@
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
7.545474328635344563e-03
-6.089395260702398522e-06
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
Expand Down Expand Up @@ -264,14 +264,14 @@
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
2.522794376870529653e-03
8.115104924275230074e-04
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
-7.008930190081533868e-03
9.939013723965425262e-01
0.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
Expand Down
Loading