def get_defined_gates(program: Program) -> tuple[dict, dict]:
    """Get the gate definitions for the program. Will include the default SUPPORTED_GATES, in
    addition to any gates defined in the Quil

    Args:
        program: A pyquil program which may contain some DefGates.

    Returns:
        A dictionary mapping quil gate names to Cirq Gates
        A dictionary mapping quil gate names to callable parameter transformers
    """
    defined_gates = SUPPORTED_GATES.copy()
    parameter_transformers = PARAMETRIC_TRANSFORMERS.copy()
    for defgate in program.defined_gates:
        if defgate.parameters:
            defined_gates[defgate.name] = defgate_to_cirq(defgate)
            parameter_transformers[defgate.name] = lambda *args: {
                p.name: a for p, a in zip(defgate.parameters, args)
            }
        else:
            defined_gates[defgate.name] = MatrixGate(
                np.asarray(defgate.matrix, dtype=np.complex128)
            )
    return defined_gates, parameter_transformers
Get the gate definitions for the program. Will include the default SUPPORTED_GATES, in
    addition to any gates defined in the Quil

    Args:
        program: A pyquil program which may contain some DefGates.

    Returns:
        A dictionary mapping quil gate names to Cirq Gates
        A dictionary mapping quil gate names to callable parameter transformers
    
cirq-rigetti/cirq_rigetti/quil_input.py