Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 7, 2023
1 parent 4e5e5ce commit 50de63d
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 12 deletions.
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
#
autodoc_member_order = "bysource"


# Adapted this from
# https://github.com/readthedocs/recommonmark/blob/ddd56e7717e9745f11300059e4268e204138a6b1/docs/conf.py
# app setup hook
Expand Down
1 change: 0 additions & 1 deletion examples/anomaly_detection/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def compute_loss_test(encoder, vector):

# Make graphs for performance analysis
if plot:

"""Loss distribution graph"""
plt.hist(loss_a, bins=60, histtype="step", color="red", label="Anomalous data")
plt.hist(loss_s, bins=60, histtype="step", color="blue", label="Standard data")
Expand Down
1 change: 0 additions & 1 deletion examples/qsvd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@


def main(nqubits, subsize, nlayers, nshots, RY, method, maxiter):

# We initialize the QSVD
Qsvd = QSVD(nqubits, subsize, nlayers, RY=RY)

Expand Down
1 change: 0 additions & 1 deletion examples/qsvd/qsvd.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def Schmidt_coeff(self, theta, init_state, nshots=100000):

Schmidt = []
for i in range(2**small):

bit_string = bin(i)[2:].zfill(small)
Schmidt.append(result[2 * bit_string])

Expand Down
4 changes: 2 additions & 2 deletions examples/reuploading_classifier/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def fig_template(name):
elif name == "3_circles":
centers = np.array([[-1, 1], [1, 0], [-0.5, -0.5]])
radii = np.array([1, np.sqrt(6 / np.pi - 1), 1 / 2])
for (c, r) in zip(centers, radii):
for c, r in zip(centers, radii):
for ax in axs:
circle = plt.Circle(c, r, color="black", fill=False, zorder=10)
ax.add_artist(circle)
Expand All @@ -109,7 +109,7 @@ def fig_template(name):
elif name == "crown" or name == "tricrown":
centers = [[0, 0], [0, 0]]
radii = [np.sqrt(0.8), np.sqrt(0.8 - 2 / np.pi)]
for (c, r) in zip(centers, radii):
for c, r in zip(centers, radii):
for ax in axs:
circle = plt.Circle(c, r, color="black", fill=False, zorder=10)
ax.add_artist(circle)
Expand Down
1 change: 0 additions & 1 deletion examples/variational_classifier/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@


def main(nclasses, nqubits, nlayers, nshots, training, RxRzRx, method):

# We initialize the quantum classifier
RY = not RxRzRx
qc = QuantumClassifer(nclasses, nqubits, nlayers, RY=RY)
Expand Down
1 change: 0 additions & 1 deletion examples/vqregressor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@


def main(layers, learning_rate, epochs, batches, ndata, J_treshold):

# We initialize the quantum regressor
vqr = VQRegressor(layers=layers, ndata=ndata)
# and the initial parameters
Expand Down
1 change: 0 additions & 1 deletion src/qibo/models/grover.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def __init__(
check_args=(),
iterative=False,
):

self.oracle = oracle
self.initial_state_circuit = initial_state_circuit

Expand Down
1 change: 0 additions & 1 deletion src/qibo/models/variational.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def __init__(
bounds_tolerance=1e-7,
time_tolerance=1e-7,
):

if nsteps <= 0: # pragma: no cover
raise_error(
ValueError,
Expand Down
1 change: 0 additions & 1 deletion src/qibo/tests/test_derivative.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def circuit(nqubits=1):
[(1, [8.51104358e-02, 5.20075970e-01, 0]), (0.5, [0.02405061, 0.13560379, 0])],
)
def test_derivative(backend, scale_factor, grads):

# initializing the circuit
c = circuit(nqubits=1)

Expand Down
2 changes: 0 additions & 2 deletions src/qibo/tests/test_noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ def test_kraus_error(backend, density_matrix, nshots):
@pytest.mark.parametrize("idle_qubits", [True, False])
def test_noisy_circuit(backend, nshots, idle_qubits):
if nshots != 20000:

circuit = Circuit(3, density_matrix=True)
circuit.add(
[
Expand Down Expand Up @@ -420,7 +419,6 @@ def test_noisy_circuit(backend, nshots, idle_qubits):
backend.assert_allclose(final_samples, target_samples)

else:

circuit = Circuit(3, density_matrix=True)

circuit.add(
Expand Down

0 comments on commit 50de63d

Please sign in to comment.