Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter_name argument to generate_ansatz_from_circuit #14

Merged
merged 1 commit into from
Nov 4, 2024
Merged
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
3 changes: 2 additions & 1 deletion qiskit_addon_aqc_tensor/ansatz_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ def generate_ansatz_from_circuit(
/,
*,
qubits_initially_zero=False,
parameter_name: str = "theta",
) -> tuple[QuantumCircuit, list[float]]:
"""Generate an ansatz from the two-qubit connectivity structure of a circuit."""
# FIXME: handle classical bits, measurements, resets, and barriers. maybe
# conditions too?
num_qubits = qc.num_qubits
ansatz = QuantumCircuit(*qc.qregs, *qc.cregs)
param_vec = ParameterVector("theta")
param_vec = ParameterVector(parameter_name)
initial_params: list[float] = []

decomposer = OneQubitEulerDecomposer("ZXZ")
Expand Down