Task: fix issue/12311 with fractional gate in basis (Qiskit/qiskit#12511)

org: Qiskit
repo: qiskit
pr_number: 12511
issue_title: fix issue/12311 with fractional gate in basis
issue_body: <!--\r\n⚠️ If you do not respect this template, your pull request will be closed.\r\n⚠️ Your pull request title should be short detailed and understandable for all.\r\n⚠️ Also, please add a release note file using reno if the change needs to be\r\n  documented in the release notes.\r\n⚠️ If your pull request fixes an open issue, please link to the issue.\r\n\r\n- [x] I have added the tests to cover my changes.\r\n- [x] I have updated the documentation accordingly.\r\n- [x] I have read the CONTRIBUTING document.\r\n-->\r\n\r\n### Summary\r\nThis fixes an issue where an exception would be raised if transpiling a unitary gate to a backend with an RZZGate in its basis however transpiling with only `basis_gates` specified would transpile fine. \r\n\r\nfixes #12311 \r\n\r\n### Details and comments\r\nIn this case, where RZZ is the only entangling gate in the basis, decomposition of a 2q unitary gate wouldn't get synthesized in the `UnitarySynthesis` pass but would instead be synthesized in the `HighLevelSynthesis` pass because this would call the instruction's `_define` method which calls `two_qubit_cnot_decompose`. A subsequent `BasisTranslator` pass ultimately maps the cx to the rzz basis.  I'm not sure whether this indirect path to unitary synthesis is intentional.\r\n\r\nThis pr resolves the specific example posed in the issue.\r\n\r\n
resolved_issues: number: 12311
title: 2Q gate synthesis with fractional gates
body: ### Environment\r\n\r\n- **Qiskit version**: main\r\n- **Python version**: doesn't matter\r\n- **Operating system**: doesn't matter\r\n\r\n\r\n### What is happening?\r\n\r\nWhen I build a Qiskit `Target` that supports two qubit basis gates with arbitrary rotation angle, it cannot transpile the circuit if the added basis gate is other than `RZXGate` or `RXXGate`.\r\n\r\n### How can we reproduce the issue?\r\n\r\n```python\r\nfrom qiskit.providers.fake_provider import GenericBackendV2\r\nfrom qiskit import quantum_info as qi, transpile, QuantumCircuit\r\n\r\nbackend = GenericBackendV2(2, basis_gates=["rz", "rx", "rzz"])\r\nqc = QuantumCircuit(2)\r\nqc.unitary(qi.random_unitary(4), [0, 1])\r\nisa = transpile(qc, target=backend.target)\r\n```\r\nthis results in an error\r\n```\r\nTypeError: ParameterExpression with unbound parameters (dict_keys([Parameter(ϴ)])) cannot be cast to a float.\r\n```\r\nbecause it tries to get the unitary matrix of parameterized `RZZGate(Parameter(ϴ))` instruction.\r\n\r\nOn the other hand, it transpiles circuit when I directly specify the basis gates.\r\n```python\r\nisa = transpile(qc, basis_gates=["rz", "rx", "rzz"])\r\n```\r\n\r\n### What should happen?\r\n\r\n- Qiskit transpiler should support arbitrary fractional two qubit basis gates, e.g. `RZX, RXX, RYY, RZZ, RXY, ...`. \r\n- Transpiling with `Target` and giving `basis_gates` should behave identically.\r\n\r\nThis is related but might be a feature request; even if I give `RZXGate(Parameter(ϴ))` in the target, current synthesis algorithm only picks pi/4 rotation. The synthesis pass should consider another angle if there is possibility of reducing the circuit depth.\r\n\r\n### Any suggestions?\r\n\r\nNo. I'm not familiar with synthesis passes.

Reference solution:
fix_patch: diff --git a/qiskit/transpiler/passes/synthesis/unitary_synthesis.py b/qiskit/transpiler/passes/synthesis/unitary_synthesis.py\nindex ab7c5e04649f..19356adf69c9 100644\n--- a/qiskit/transpiler/passes/synthesis/unitary_synthesis.py\n+++ b/qiskit/transpiler/passes/synthesis/unitary_synthesis.py\n@@ -49,6 +49,7 @@\n     CZGate,\n     RXXGate,\n     RZXGate,\n+    RZZGate,\n     ECRGate,\n     RXGate,\n     SXGate,\n@@ -779,6 +780,8 @@ def _replace_parameterized_gate(op):\n                 op = RXXGate(pi / 2)\n             elif isinstance(op, RZXGate) and isinstance(op.params[0], Parameter):\n                 op = RZXGate(pi / 4)\n+            elif isinstance(op, RZZGate) and isinstance(op.params[0], Parameter):\n+                op = RZZGate(pi / 2)\n             return op\n \n         try:\n