fromJson_Gate_Matrix = props => {
    let mat = _parseGateMatrix(props.matrix);

    // Special case the mystery gate.
    if (props.id === MysteryGateSymbol) {
        return MysteryGateMakerWithMatrix(mat);
    }

    let height = Math.round(Math.log2(mat.height()));
    let width = props.symbol === '' ? height : 1;
    let matrix = _parseGateMatrix(props.matrix);

    let builder = new GateBuilder().
        setSerializedId(props.id).
        setSymbol(props.symbol).
        setTitle(props.name).
        setHeight(height).
        setWidth(width).
        setDrawer(props.symbol === "" ? matrixDrawer
            : matrix.isIdentity() ? labelDrawer
            : matrix.isScaler() ? locationIndependentDrawer
            : undefined).
        setKnownEffectToMatrix(matrix);
    if (matrix.isIdentity()) {
        builder.markAsNotInterestedInControls();
    }
    return builder.gate;
}
@param {!{id: !String, matrix: *, circuit: *, symbol: *, name: *, param: *}} props
@returns {!Gate}