def _create_virtual_processor_from_device(
    processor_id: str,
    device: cirq.Device,
    device_specification: v2.device_pb2.DeviceSpecification | None = None,
) -> simulated_local_processor.SimulatedLocalProcessor:
    """Creates a Processor object that is backed by a noiseless simulator.

    Creates a noiseless `AbstractProcessor` object based on the cirq simulator,
    a default validator, and a provided device.

    Args:
        processor_id: name of the processor to simulate.  This is an arbitrary
            string identifier and does not have to match the processor's name
            in QCS.
        device: A `cirq.Device` to validate circuits against.
        device_specification: a` DeviceSpecification` proto that the processor
            should return if `get_device_specification()` is queried.
    """
    calibration = _create_perfect_calibration(device)
    return simulated_local_processor.SimulatedLocalProcessor(
        processor_id=processor_id,
        device=device,
        validator=engine_validator.create_engine_validator(),
        program_validator=engine_validator.create_program_validator(),
        calibrations={calibration.timestamp // 1000: calibration},
        device_specification=device_specification,
    )
Creates a Processor object that is backed by a noiseless simulator.

    Creates a noiseless `AbstractProcessor` object based on the cirq simulator,
    a default validator, and a provided device.

    Args:
        processor_id: name of the processor to simulate.  This is an arbitrary
            string identifier and does not have to match the processor's name
            in QCS.
        device: A `cirq.Device` to validate circuits against.
        device_specification: a` DeviceSpecification` proto that the processor
            should return if `get_device_specification()` is queried.
    
cirq-google/cirq_google/engine/virtual_engine_factory.py