From b44d0c16ec0cb5954c9073bf3fae44fedcf8c2c3 Mon Sep 17 00:00:00 2001 From: Lucy-Xing Date: Wed, 1 Sep 2021 09:30:30 -0400 Subject: [PATCH 1/3] update runtime program template --- qiskit/providers/ibmq/runtime/program/program_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit/providers/ibmq/runtime/program/program_template.py b/qiskit/providers/ibmq/runtime/program/program_template.py index e5c328e96..1d0b7fd3f 100644 --- a/qiskit/providers/ibmq/runtime/program/program_template.py +++ b/qiskit/providers/ibmq/runtime/program/program_template.py @@ -42,5 +42,5 @@ def main(backend: ProgramBackend, user_messenger: UserMessenger, **kwargs): """ # Massage the input if necessary. result = program(backend, user_messenger, **kwargs) - # UserMessenger can be used to publish final results. - user_messenger.publish(result, final=True) + # final results can be directly returned + return result From 98f50b7afad292ee41d69c8612c296b6774e4281 Mon Sep 17 00:00:00 2001 From: Lucy-Xing Date: Wed, 1 Sep 2021 09:32:55 -0400 Subject: [PATCH 2/3] update docstring --- qiskit/providers/ibmq/runtime/program/program_template.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qiskit/providers/ibmq/runtime/program/program_template.py b/qiskit/providers/ibmq/runtime/program/program_template.py index 1d0b7fd3f..f68636b2e 100644 --- a/qiskit/providers/ibmq/runtime/program/program_template.py +++ b/qiskit/providers/ibmq/runtime/program/program_template.py @@ -39,6 +39,9 @@ def main(backend: ProgramBackend, user_messenger: UserMessenger, **kwargs): backend: Backend for the circuits to run on. user_messenger: Used to communicate with the program user. kwargs: User inputs. + + Returns: + any: The final result of the runtime program. """ # Massage the input if necessary. result = program(backend, user_messenger, **kwargs) From 926f46918189cf6383d4dbeaf3b30ae01fff3bbb Mon Sep 17 00:00:00 2001 From: Lucy-Xing Date: Wed, 1 Sep 2021 09:33:56 -0400 Subject: [PATCH 3/3] update docstring --- qiskit/providers/ibmq/runtime/program/program_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit/providers/ibmq/runtime/program/program_template.py b/qiskit/providers/ibmq/runtime/program/program_template.py index f68636b2e..85ad5810e 100644 --- a/qiskit/providers/ibmq/runtime/program/program_template.py +++ b/qiskit/providers/ibmq/runtime/program/program_template.py @@ -41,7 +41,7 @@ def main(backend: ProgramBackend, user_messenger: UserMessenger, **kwargs): kwargs: User inputs. Returns: - any: The final result of the runtime program. + The final result of the runtime program. """ # Massage the input if necessary. result = program(backend, user_messenger, **kwargs)