Skip to content
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
32 changes: 16 additions & 16 deletions examples/encoding_circuits/various_encoding_circuit.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(
else:
self._qiskit_circuit = qiskit_circuit

self._num_qubits = self._qiskit_circuit.num_qubits
super().__init__(num_qubits=self._qiskit_circuit.num_qubits)
self._mode = mode
self._feature_label = feature_label
self._parameter_label = parameter_label
Expand Down Expand Up @@ -126,6 +126,11 @@ def __init__(
else:
raise ValueError("The type {} is not supported!".format(self._mode))

@property
def num_encoding_slots(self) -> int:
"""The number of encoding slots of the encoding circuit."""
return self._num_features

@property
def num_parameters(self) -> int:
"""The number of trainable parameters of the Qiskit encoding circuit."""
Expand Down Expand Up @@ -165,9 +170,9 @@ def get_circuit(

Args:
features (Union[ParameterVector,np.ndarray]): Input vector of the features
from which the gate inputs are obtained.
param_vec (Union[ParameterVector,np.ndarray]): Input vector of the parameters
from which the gate inputs are obtained.
from which the gate inputs are obtained.
parameters (Union[ParameterVector,np.ndarray]): Input vector of the parameters
from which the gate inputs are obtained.

Return:
The circuit of the Qiskit Encoding Circuit with the assigned parameters.
Expand Down
1 change: 1 addition & 0 deletions src/squlearn/encoding_circuit/encoding_circuit_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def feature_bounds(self) -> np.ndarray:
return np.array([-np.pi, np.pi])

@property
@abstractmethod
def num_encoding_slots(self) -> int:
"""The number of encoding slots of the encoding circuit."""
raise NotImplementedError()
Expand Down