Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDSIM version of Sampler primitive #300

Merged
merged 74 commits into from
Dec 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
1409e27
Backends now support parametrized circuits
andresbar98 Sep 12, 2023
d511592
Merge branch 'cda-tum:main' into qiskit_primitives
andresbar98 Sep 13, 2023
b041d87
Simplify code for handling parametrized gates
andresbar98 Sep 13, 2023
7fa297f
Added tests for parametrized gates
andresbar98 Sep 13, 2023
274a1d2
🎨 pre-commit fixes
pre-commit-ci[bot] Sep 13, 2023
b2bab59
Fixed typing errors and improved test coverage
andresbar98 Sep 14, 2023
7f83216
Simulated circuits are now a backend's attribute
andresbar98 Sep 17, 2023
b778302
Solved minor issues/Redefined _bind_parameters method
andresbar98 Sep 22, 2023
c022213
Simplified loops/Added verifiers to _bind_parameters() method
andresbar98 Sep 25, 2023
997e855
Update src/mqt/ddsim/qasmsimulator.py
andresbar98 Sep 26, 2023
56fb712
Update src/mqt/ddsim/qasmsimulator.py
andresbar98 Sep 26, 2023
bca90fc
Update src/mqt/ddsim/qasmsimulator.py
andresbar98 Sep 26, 2023
e5bdab1
Simplified tests/Improved syntax
andresbar98 Sep 26, 2023
7f7b4e4
🏷️ proper typing
burgholzer Sep 27, 2023
57b49b9
♻️ refactor parameter assignment logic
burgholzer Sep 27, 2023
6fa93f7
✅ adjust tests
burgholzer Sep 27, 2023
9f69586
Merge branch 'qiskit_primitives'
andresbar98 Sep 28, 2023
26f45ef
First DDSIM version of Sampler
andresbar98 Sep 28, 2023
8a9d1bb
🎨 pre-commit fixes
pre-commit-ci[bot] Sep 28, 2023
00683b3
Fixed small errors
andresbar98 Sep 29, 2023
a239550
Sampler now depends exclusively on QasmSimulatorBackend
andresbar98 Sep 30, 2023
40b1f30
First test for DDSIM sampler
andresbar98 Sep 30, 2023
513802d
🎨 pre-commit fixes
pre-commit-ci[bot] Sep 30, 2023
2774b0c
Raise qiskit-terra minimum version
andresbar98 Sep 30, 2023
8c2f48c
Merge branch 'DDSIM_Sampler' of https://github.com/andresbar98/mqt-dd…
andresbar98 Sep 30, 2023
f037db8
🎨 pre-commit fixes
pre-commit-ci[bot] Sep 30, 2023
3920aa7
Change Qiskit-terra version
andresbar98 Oct 1, 2023
6892df7
Adjust class definition to minimum version
andresbar98 Oct 7, 2023
698ef16
Improved test coverage
andresbar98 Oct 7, 2023
1b6970e
Improved test coverage
andresbar98 Oct 7, 2023
dd09d36
API Documentation + Demo for DDSIMSampler
andresbar98 Oct 14, 2023
630396f
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 14, 2023
4090e79
Fixed errors in demo notebook
andresbar98 Oct 14, 2023
988fc7f
Merge branch 'cda-tum:main' into DDSIM_Sampler
andresbar98 Oct 14, 2023
0a6bd2c
Merge branch 'cda-tum:main' into DDSIM_Sampler
andresbar98 Oct 18, 2023
ebbb1b9
retrigger checks
andresbar98 Oct 19, 2023
dfbf44a
Fix indicators
andresbar98 Oct 23, 2023
bfa13f7
Simplified Sampler's features
andresbar98 Oct 23, 2023
5a4faf0
Adapt python notebook documentation
andresbar98 Oct 23, 2023
961bedb
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 23, 2023
6a27036
Merge branch 'main' into DDSIM_Sampler
burgholzer Oct 24, 2023
559580f
Expanded python notebook documentation
andresbar98 Oct 26, 2023
c0b576a
Improved Sampler's functionality/Better typing
andresbar98 Oct 27, 2023
591d2da
Linked documentation
andresbar98 Oct 27, 2023
5a83045
🎨 pre-commit fixes
pre-commit-ci[bot] Oct 27, 2023
e5ab232
Improved test methods and coverage
andresbar98 Oct 29, 2023
4e8d855
Notebook documentation more organized
andresbar98 Oct 29, 2023
1218a38
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 4, 2023
dc973f4
Raised minimum version/Better typing
andresbar98 Nov 4, 2023
64608e1
Merge branch 'cda-tum:main' into DDSIM_Sampler
andresbar98 Nov 4, 2023
bf45f11
Merge branch 'cda-tum:main' into DDSIM_Sampler
andresbar98 Nov 10, 2023
3b0ef40
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 10, 2023
277c571
Missing annotations
andresbar98 Nov 10, 2023
bdc7a91
Merge branch 'cda-tum:main' into DDSIM_Sampler
andresbar98 Nov 17, 2023
5276dd0
Update minimum version in pyproject.toml
andresbar98 Nov 17, 2023
497e912
Improved typing
andresbar98 Nov 17, 2023
319c5f9
Remove transpilation from Sampler
andresbar98 Nov 17, 2023
ed8734b
Increase tolerance
andresbar98 Nov 17, 2023
722bcce
Merge branch 'cda-tum:main' into DDSIM_Sampler
andresbar98 Nov 28, 2023
3b094f6
Better typing
andresbar98 Nov 28, 2023
bae1854
Update test/python/test_sampler.py
burgholzer Nov 28, 2023
bf373a5
Better typing and test performance
andresbar98 Nov 28, 2023
6e84635
Better typing
andresbar98 Nov 29, 2023
28ecf45
Bump the submodules group with 3 updates (#324)
dependabot[bot] Dec 1, 2023
f99904f
⬆️🪝 update pre-commit hooks (#325)
pre-commit-ci[bot] Dec 4, 2023
43435af
✏️ slight fine-tuning
burgholzer Dec 5, 2023
3aaaff9
🚚 move primitives to their own folder
burgholzer Dec 5, 2023
9c4eca9
⏪ revert unnecessary change
burgholzer Dec 5, 2023
217abd8
🏷️ slighlty better typing
burgholzer Dec 5, 2023
86a8358
📝 fix docstrings
burgholzer Dec 5, 2023
56d403e
⚡ slight performance improvement
burgholzer Dec 5, 2023
0aa2261
🏷️ proper typing in tests
burgholzer Dec 5, 2023
83cd8af
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 5, 2023
cf53c9e
Merge branch 'main' into DDSIM_Sampler
burgholzer Dec 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Missing annotations
  • Loading branch information
andresbar98 committed Nov 10, 2023
commit 277c5710724d8929cf3bf0e2654a9a13817edc76
2 changes: 1 addition & 1 deletion docs/source/Primitives.ipynb
burgholzer marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -182,7 +182,7 @@
"\n",
"\n",
"# Define an oracle circuit that marks the input states, which are represented as a list of bitstrings\n",
"def grover_oracle(marked_states):\n",
"def grover_oracle(marked_states: list) -> QuantumCircuit:\n",
" if not isinstance(marked_states, list):\n",
" marked_states = [marked_states]\n",
" # Compute the number of qubits in circuit\n",
11 changes: 6 additions & 5 deletions src/mqt/ddsim/sampler.py
andresbar98 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -44,10 +44,10 @@ def transpiled_circuits(self) -> list[QuantumCircuit]:
return self._transpiled_circuits

@property
def backend(self):
def backend(self) -> QasmSimulatorBackend:
return self._BACKEND

def _transpile(self):
def _transpile(self) -> None:
"""Transpiles circuits stored in the instance.
Circuits are only transpiled once. If no new circuits are provided, compilation is skipped on further calls to the method
"""
@@ -66,7 +66,7 @@ def _run(
self,
circuits: Sequence[QuantumCircuit],
parameter_values: Sequence[Parameters],
**run_options,
**run_options: dict[str, Any],
andresbar98 marked this conversation as resolved.
Show resolved Hide resolved
) -> PrimitiveJob:
"""Stores circuits and parameters within the instance.
Executes _call function.
@@ -97,7 +97,7 @@ def _call(
self,
circuits: Sequence[int],
parameter_values: Sequence[Parameters],
**run_options,
**run_options: dict[str, Any],
andresbar98 marked this conversation as resolved.
Show resolved Hide resolved
) -> SamplerResult:
"""Executes transpilation and runs DDSIM backend

@@ -109,7 +109,8 @@ def _call(

return self._postprocessing(result, circuits)

def _postprocessing(self, result: Result, circuits: Sequence[int]) -> SamplerResult:
@staticmethod
def _postprocessing(result: Result, circuits: Sequence[int]) -> SamplerResult:
"""Converts counts into quasi-probability distributions

Returns: