Traditionally, the LUCJ ansatz has this form:
U1 -> J1 -> U1dag -> U2 -> J2 -> U2dag -> ...
but when we convert it to a quantum circuit, we merge the orbital rotations and the resulting circuit has this form:
U1 -> J1 -> U2 -> J2 -> ...
This form is more natural for optimizing a Qiskit circuit using, for example, AQC-Tensor.
The function we add should have the same behavior as this:
from qiskit.circuit import QuantumCircuit, QuantumRegister
from qiskit_addon_aqc_tensor import parametrize_circuit
import ffsim
def ucj_spin_balanced_ansatz(
norb: int,
n_reps: int,
interaction_pairs: tuple[
list[tuple[int, int]] | None, list[tuple[int, int]] | None
],
) -> QuantumCircuit:
ucj_op = ffsim.random.random_ucj_op_spin_balanced(
norb,
n_reps=n_reps,
interaction_pairs=interaction_pairs,
)
qubits = QuantumRegister(2 * norb)
circuit = QuantumCircuit(qubits)
circuit.append(ffsim.qiskit.UCJOpSpinBalancedJW(ucj_op), qubits)
circuit = ffsim.qiskit.PRE_INIT.run(circuit).decompose()
ansatz, parameters = parametrize_circuit(circuit)
return ansatz
Here the parameters are discarded, but we should also have a function to generate the parameters from t2 amplitudes.
Traditionally, the LUCJ ansatz has this form:
but when we convert it to a quantum circuit, we merge the orbital rotations and the resulting circuit has this form:
This form is more natural for optimizing a Qiskit circuit using, for example, AQC-Tensor.
The function we add should have the same behavior as this:
Here the
parametersare discarded, but we should also have a function to generate the parameters from t2 amplitudes.