def get_op_string(op_obj: cirq.Operation) -> str:
    """Find the string representation for a given gate or operation.

    Args:
        op_obj: Gate or operation object. Gate must be one of: XXPowGate,
            ZPowGate, PhasedXPowGate, or MeasurementGate.

    Returns:
        String representing the gate operations.

    Raises:
        ValueError: If the gate is not one of the supported gates.
    """
    if isinstance(op_obj.gate, cirq.XXPowGate):
        op_str = OperationString.MS.value
    elif isinstance(op_obj.gate, cirq.ZPowGate):
        op_str = OperationString.Z.value
    elif isinstance(op_obj.gate, cirq.PhasedXPowGate):
        op_str = OperationString.R.value
    elif isinstance(op_obj.gate, cirq.MeasurementGate):
        op_str = OperationString.MEASURE.value
    else:
        raise ValueError(f'Got unknown gate on operation: {op_obj}.')
    return str(op_str)
Find the string representation for a given gate or operation.

    Args:
        op_obj: Gate or operation object. Gate must be one of: XXPowGate,
            ZPowGate, PhasedXPowGate, or MeasurementGate.

    Returns:
        String representing the gate operations.

    Raises:
        ValueError: If the gate is not one of the supported gates.
    
cirq-aqt/cirq_aqt/aqt_device.py