Skip to content

Commit

Permalink
Stavros' suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomello committed Nov 1, 2023
1 parent 8c9828a commit a2ce474
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/qibo/models/encodings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import math

import numpy as np
from scipy.stats import rv_continuous

from qibo import gates
from qibo.backends import GlobalBackend
from qibo.config import raise_error
from qibo.models.circuit import Circuit

Expand Down Expand Up @@ -76,7 +74,8 @@ def unary_encoder(data):


def _generate_rbs_pairs(nqubits):
# generating list of indexes representing the RBS connections
"""Generating list of indexes representing the RBS connections
and creating circuit with all RBS initialised with 0.0 phase."""
pairs_rbs = [[(0, int(nqubits / 2))]]
indexes = list(np.array(pairs_rbs).flatten())
for depth in range(2, int(math.log2(nqubits)) + 1):
Expand All @@ -86,7 +85,6 @@ def _generate_rbs_pairs(nqubits):
pairs_rbs += pairs_rbs_per_depth
indexes = list(np.array(pairs_rbs_per_depth).flatten())

# creating circuit with all RBS initialised with 0.0 phase
circuit = Circuit(nqubits)
circuit.add(gates.X(0))
for row in pairs_rbs:
Expand Down

0 comments on commit a2ce474

Please sign in to comment.