Skip to content

Commit

Permalink
Modified param_prefix to have a non-empty default.
Browse files Browse the repository at this point in the history
  • Loading branch information
smitchaudhary committed Dec 19, 2023
1 parent ebff618 commit bdaddf4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions qadence/constructors/iia.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _rotations(
def identity_initialized_ansatz(
n_qubits: int,
depth: int = 1,
param_prefix: str = "",
param_prefix: str = "iia",
rotations: Any = [RX, RY],
entangler: Any = CNOT,
periodic: bool = False,
Expand Down Expand Up @@ -96,12 +96,12 @@ def identity_initialized_ansatz(
n_qubits=n_qubits,
layer=layer,
side="left",
param_str=f"{param_prefix}_alpha",
param_str=f"{param_prefix}",
values=alpha,
ops=rotations,
)

ent_param_prefix = f"{param_prefix}_theta_ent_"
ent_param_prefix = f"{param_prefix}_θ_ent_"
if not periodic:
left_entanglers = [
chain(
Expand Down Expand Up @@ -131,9 +131,7 @@ def identity_initialized_ansatz(
kron(
RX(
target=n,
parameter=Parameter(
name=f"{param_prefix}_gamma" + f"_{layer}{n}", value=gamma[n]
),
parameter=Parameter(name=f"{param_prefix}_γ" + f"_{layer}{n}", value=gamma[n]),
)
for n in range(n_qubits)
)
Expand All @@ -145,7 +143,7 @@ def identity_initialized_ansatz(
n_qubits=n_qubits,
layer=layer,
side="right",
param_str=f"{param_prefix}_beta",
param_str=f"{param_prefix}",
values=beta,
ops=rotations,
)
Expand Down

0 comments on commit bdaddf4

Please sign in to comment.