Skip to content

Commit

Permalink
fixed qa
Browse files Browse the repository at this point in the history
Signed-off-by: Melvin Strobl <[email protected]>
  • Loading branch information
Melvin Strobl committed Oct 7, 2024
1 parent 04b4dd7 commit 70ccc91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions qml_essentials/expressibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def _sample_state_fidelities(

# Generate random parameter sets
# w: np.ndarray = (
# 2 * np.pi * (1 - 2 * rng.random(size=[*model.params.shape, n_samples * 2]))
# 2 * np.pi * (1 - 2 * rng.random(size=[*model.params.shape, \
# n_samples * 2]))
# )
# TODO: why do we need *2? is there anything important regarding the shift abovce?
model.initialize_params(rng=rng, repeat=n_samples * 2)
Expand Down Expand Up @@ -91,7 +92,8 @@ def state_fidelities(
Args:
n_bins (int): Number of histogram bins.
n_samples (int): Number of parameter sets to generate.
n_input_samples (int): Number of samples for the input domain in [-pi, pi]
n_input_samples (int): Number of samples for the input domain
in [-pi, pi]
seed (int): Random number generator seed.
model (Callable): Function that models the quantum circuit.
kwargs (Any): Additional keyword arguments for the model function.
Expand Down
9 changes: 6 additions & 3 deletions qml_essentials/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,12 @@ def initialize_params(
Args:
rng: A random number generator to use for initialization.
repeat: The number of times to repeat the parameters. If None, the number of layers is used.
initialization: The strategy to use for parameter initialization. If None, the strategy specified in the constructor is used.
initialization_domain: The domain to use for parameter initialization. If None, the domain specified in the constructor is used.
repeat: The number of times to repeat the parameters.
If None, the number of layers is used.
initialization: The strategy to use for parameter initialization.
If None, the strategy specified in the constructor is used.
initialization_domain: The domain to use for parameter initialization.
If None, the domain specified in the constructor is used.
Returns:
None
Expand Down

0 comments on commit 70ccc91

Please sign in to comment.