From 3c8f0f1a712657b1ea088d47ba03b4e8105cb1fb Mon Sep 17 00:00:00 2001 From: Jake Lishman Date: Fri, 19 Apr 2024 03:56:00 +0100 Subject: [PATCH] Fix mistaken QPY custom-instructions documentation (#12216) `num_custom_gates` is not actually part of the `CIRCUIT_HEADER` structs in any version of QPY. The number of custom-instruction objects is instead stored as a `uint64_t` inline in the `CUSTOM_DEFINITIONS` part of the file, so separately to the rest of the header. (cherry picked from commit 5dbc0c04cec1327977be788b50f554c3c7cda344) --- qiskit/qpy/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/qiskit/qpy/__init__.py b/qiskit/qpy/__init__.py index 9f790b9f308..01783f138d9 100644 --- a/qiskit/qpy/__init__.py +++ b/qiskit/qpy/__init__.py @@ -1041,7 +1041,6 @@ uint64_t metadata_size; uint32_t num_registers; uint64_t num_instructions; - uint64_t num_custom_gates; } This is immediately followed by ``name_size`` bytes of utf8 data for the name @@ -1074,7 +1073,6 @@ uint64_t metadata_size; uint32_t num_registers; uint64_t num_instructions; - uint64_t num_custom_gates; } This is immediately followed by ``name_size`` bytes of utf8 data for the name