Skip to content

Commit

Permalink
Add alias iia for identity initialised ansatz
Browse files Browse the repository at this point in the history
  • Loading branch information
smitchaudhary committed Nov 27, 2024
1 parent 8e8ae65 commit 508f7c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions qadence/constructors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

from .hea import hea
from .alt import alt

from .iia import identity_initialized_ansatz
from .iia import identity_initialized_ansatz, iia

from .daqc import daqc_transform

Expand All @@ -32,6 +31,7 @@
"hea",
"alt",
"identity_initialized_ansatz",
"iia",
"hamiltonian_factory",
"ising_hamiltonian",
"ObservableConfig",
Expand Down
3 changes: 3 additions & 0 deletions qadence/constructors/iia.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,6 @@ def identity_initialized_ansatz(
initialized_layers.append(tag(chain(*krons), tag=f"BPMA-{layer}"))

return chain(*initialized_layers)


iia = identity_initialized_ansatz
6 changes: 3 additions & 3 deletions qadence/ml_tools/constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
analog_feature_map,
feature_map,
hamiltonian_factory,
identity_initialized_ansatz,
iia,
rydberg_feature_map,
rydberg_hea,
rydberg_tower_feature_map,
Expand Down Expand Up @@ -414,7 +414,7 @@ def _create_iia_digital(
entangler = config.strategy_args.get("entangler", CNOT)
periodic = config.strategy_args.get("periodic", False)

return identity_initialized_ansatz(
return iia(
n_qubits=num_qubits,
depth=config.depth,
param_prefix=config.param_prefix,
Expand Down Expand Up @@ -443,7 +443,7 @@ def _create_iia_sdaqc(
entangler = config.strategy_args.get("entangler", CNOT)
periodic = config.strategy_args.get("periodic", False)

return identity_initialized_ansatz(
return iia(
n_qubits=num_qubits,
depth=config.depth,
param_prefix=config.param_prefix,
Expand Down

0 comments on commit 508f7c2

Please sign in to comment.