I have a quantum circuit with 3 two-qubits gates XX, YY, and ZZ (as defined in the qiskit circuit library) with arbitrary angles on each gate. I'd like to replace the YY and ZZ gates with XXs. I know how to do this mathematically with RZ and RY single qubit rotations, but I don't know how to programmically get Qiskit to do this switch. Unfortunately, the transpiler converts the YY and ZZ into CNOTs and then into XXs (evaluated at $\pi/2$). I want to avoid this though and preserve the arbitrary angles on YY and ZZ when converting them into XX gates. Is there a way I can tell the transpiler how to handle YY and ZZ gates?
Or maybe remove the YY and ZZ gates from the quantum circuit from QuantumCircuit.data and insert XX gates (with the appropriate RZ and RY rotations)?