No support for symbolic parameters for MatrixGate (U-gate) #6810
Description
Is your feature request related to a use case or problem? Please describe.
Cirq does not currently support symbolic parameters, such as sympy.Symbol, for the MatrixGate (U-gate). While symbolic parameters are supported in other gates like rx, ry, and rz, the same functionality is not available for custom gates using MatrixGate.
The error below is raised when attempting to simulate the circuit with a symbolic parameter:
TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule 'safe'.
Describe the solution you'd like
Expected that Cirq would handle symbolic parameters in the MatrixGate and allow for symbolic computation during simulation, just as it does with gates like rx, ry, and rz. Qiskit handles symbolic parameters using its Parameter() class, including for U-gates.
[optional] Describe alternatives/workarounds you've considered
[optional] Additional context (e.g. screenshots)
What is the urgency from your perspective for this issue? Is it blocking important work?
P3 - I'm not really blocked by it, it is an idea I'd like to discuss / suggestion based on principle