diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 00000000..daf956c1 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,9 @@ +name: Lint Commit Messages +on: [push, pull_request] + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: wagoid/commitlint-github-action@v5 diff --git a/quafu/algorithms/estimator.py b/quafu/algorithms/estimator.py index dfe7ad4b..f8c8dac1 100644 --- a/quafu/algorithms/estimator.py +++ b/quafu/algorithms/estimator.py @@ -53,6 +53,9 @@ def _run_real_machine(self, observables: Hamiltonian): """Submit to quafu service""" if not isinstance(self._task, Task): raise ValueError("task not set") + # TODO(zhaoyilun): replace old `submit` API in the future, + # investigate the best implementation for calculating + # expectation on real devices. obs = observables.to_legacy_quafu_pauli_list() _, obsexp = self._task.submit(self._circ, obs) return sum(obsexp)