@@ -233,6 +233,38 @@ def test_cirq_generic_to_cirq_result_drops_non_binary_shots_and_exposes_raw():
233233 )
234234
235235
236+ def test_cirq_service_targets_excludes_non_qir_target ():
237+ """Targets without a target_profile (e.g. Pasqal) must not be wrapped as
238+ AzureGenericQirCirqTarget — they use pulse-level input formats incompatible
239+ with QIR submission.
240+ """
241+ pytest .importorskip ("cirq" )
242+ pytest .importorskip ("cirq_ionq" )
243+
244+ from azure .quantum .cirq .service import AzureQuantumService
245+ from azure .quantum .cirq .targets .generic import AzureGenericQirCirqTarget
246+
247+ from mock_client import create_default_workspace
248+
249+ ws = create_default_workspace ()
250+ _freeze_workspace_client_recreation (ws )
251+ service = AzureQuantumService (workspace = ws )
252+
253+ targets = service .targets ()
254+ target_names = [t .name for t in targets ]
255+
256+ # The Pasqal target (target_profile=None) should be completely absent.
257+ assert not any (
258+ "pasqal" in name for name in target_names
259+ ), f"Non-QIR Pasqal target unexpectedly appeared in service.targets(): { target_names } "
260+ # Specifically, no AzureGenericQirCirqTarget should have been created for it.
261+ assert not any (
262+ isinstance (t , AzureGenericQirCirqTarget ) and "pasqal" in t .name for t in targets
263+ )
264+ # QIR-capable targets should still be present.
265+ assert any ("microsoft.estimator" in name for name in target_names )
266+
267+
236268def test_cirq_service_targets_discovers_provider_specific_and_generic_wrappers (
237269 monkeypatch : pytest .MonkeyPatch ,
238270):
0 commit comments