def create_default_noisy_quantum_virtual_machine(
    processor_id: str, simulator_class: type[cirq.SimulatesSamples] | None = None, **kwargs
) -> SimulatedLocalEngine:
    """Creates a virtual engine with a noisy simulator based on a processor id.

    Args:
        processor_id: The string name of a processor that has available noise data.
            Use `list_virtual_processors` to obtain available names.
        simulator_class: The class of the type of simulator to be initialized. The
            simulator class initializer needs to support the `noise` parameter.
        **kwargs: Other arguments which are passed through to the simulator initializer.
            The 'noise' argument will be overwritten with a new noise model.

    Returns:
        A SimulatedLocalEngine that uses a simulator of type simulator_class with a
            noise model based on available noise data for the processor processor_id.
    """

    if simulator_class is None:
        try:  # pragma: no cover
            import qsimcirq

            simulator_class = qsimcirq.QSimSimulator  # pragma: no cover
        except ImportError:
            simulator_class = cirq.Simulator  # pragma: no cover

    calibration = load_median_device_calibration(processor_id)
    device = create_device_from_processor_id(processor_id)
    noise_properties = load_device_noise_properties(processor_id)
    noise_model = NoiseModelFromGoogleNoiseProperties(noise_properties)
    simulator = simulator_class(noise=noise_model, **kwargs)  # type: ignore

    device_specification = create_device_spec_from_processor_id(processor_id)
    simulated_processor = SimulatedLocalProcessor(
        processor_id=processor_id,
        sampler=simulator,
        device=device,
        calibrations={calibration.timestamp // 1000: calibration},
        device_specification=device_specification,
    )

    return SimulatedLocalEngine([simulated_processor])
Creates a virtual engine with a noisy simulator based on a processor id.

    Args:
        processor_id: The string name of a processor that has available noise data.
            Use `list_virtual_processors` to obtain available names.
        simulator_class: The class of the type of simulator to be initialized. The
            simulator class initializer needs to support the `noise` parameter.
        **kwargs: Other arguments which are passed through to the simulator initializer.
            The 'noise' argument will be overwritten with a new noise model.

    Returns:
        A SimulatedLocalEngine that uses a simulator of type simulator_class with a
            noise model based on available noise data for the processor processor_id.
    
cirq-google/cirq_google/engine/virtual_engine_factory.py