Repository: Qiskit/qiskit (python)

Issue:
using the preset pass managers
### What should we add?

First the pass manager is awesome I have not used it for a while and it is really powerful and improved a lot. I personally don't see why we need to use the transpile function anymore (we should seriously consider depreciating it). This being said the generate_preset_pass_manager passes I think we should make a bit more user friendly.  

I would make it so that  

```
pm =  generate_preset_pass_manager(basis_gates = ['cz', 'sx', 'rz'],  coupling_map =[[0,1], [1,2]], optimization_level=3)
```
should work and not need me to make an object CouplingMap to pass into the generate_preset_pass_manager function. 

Pull request description:
List support for coupling map in pass manager
<!--
⚠️ If you do not respect this template, your pull request will be closed.
⚠️ Your pull request title should be short detailed and understandable for all.
⚠️ Also, please add a release note file using reno if the change needs to be
  documented in the release notes.
⚠️ If your pull request fixes an open issue, please link to the issue.

- [ ] I have added the tests to cover my changes.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the CONTRIBUTING document.
-->

### Summary

Fixes #10920 

### Details and comments

The preset pass manager previously only allowed the user to provide a coupling map as an object, not as a list. Since the creation of a coupling map is typically a straightforward process, it makes sense to allow users to directly input the list into the preset pass manager generator. This is what this PR is about.

Example :
pm = generate_preset_pass_manager(basis_gates = ['cz', 'sx', 'rz'], coupling_map =[[0,1], [1,2]], optimization_level=3)

Patch:
diff --git a/Cargo.lock b/Cargo.lock
index 11a06e685..21bcb3ca0 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -108,9 +108,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
 
 [[package]]
 name = "hashbrown"
-version = "0.14.0"
+version = "0.14.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
+checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156"
 dependencies = [
  "ahash",
  "allocator-api2",
@@ -129,12 +129,12 @@ dependencies = [
 
 [[package]]
 name = "indexmap"
-version = "2.0.1"
+version = "2.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad227c3af19d4914570ad36d30409928b75967c298feb9ea1969db3a610bb14e"
+checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897"
 dependencies = [
  "equivalent",
- "hashbrown 0.14.0",
+ "hashbrown 0.14.2",
  "rayon",
 ]
 
@@ -334,8 +334,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "e681a6cfdc4adcc93b4d3cf993749a4552018ee0a9b65fc0ccfad74352c72a38"
 dependencies = [
  "cfg-if",
- "hashbrown 0.14.0",
- "indexmap 2.0.1",
+ "hashbrown 0.14.2",
+ "indexmap 2.0.2",
  "indoc",
  "libc",
  "memoffset",
@@ -395,7 +395,7 @@ dependencies = [
 name = "qiskit-qasm2"
 version = "1.0.0"
 dependencies = [
- "hashbrown 0.14.0",
+ "hashbrown 0.14.2",
  "pyo3",
 ]
 
@@ -404,8 +404,8 @@ name = "qiskit_accelerate"
 version = "1.0.0"
 dependencies = [
  "ahash",
- "hashbrown 0.14.0",
- "indexmap 2.0.1",
+ "hashbrown 0.14.2",
+ "indexmap 2.0.2",
  "ndarray",
  "num-bigint",
  "num-complex",
@@ -537,8 +537,8 @@ checksum = "72abf7976bc09a30391248b3c6509338b235c02b0e9b0bf8af686c289cad3f45"
 dependencies = [
  "ahash",
  "fixedbitset",
- "hashbrown 0.14.0",
- "indexmap 2.0.1",
+ "hashbrown 0.14.2",
+ "indexmap 2.0.2",
  "num-traits",
  "petgraph",
  "priority-queue",
diff --git a/crates/accelerate/Cargo.toml b/crates/accelerate/Cargo.toml
index 2051680d6..25e90763a 100644
--- a/crates/accelerate/Cargo.toml
+++ b/crates/accelerate/Cargo.toml
@@ -42,5 +42,5 @@ version = "0.14.0"
 features = ["rayon"]
 
 [dependencies.indexmap]
-version = "2.0.1"
+version = "2.0.2"
 features = ["rayon"]
diff --git a/qiskit/transpiler/preset_passmanagers/__init__.py b/qiskit/transpiler/preset_passmanagers/__init__.py
index bec81501a..ee1e407ae 100644
--- a/qiskit/transpiler/preset_passmanagers/__init__.py
+++ b/qiskit/transpiler/preset_passmanagers/__init__.py
@@ -61,6 +61,7 @@ import warnings
 
 from qiskit.transpiler.passmanager_config import PassManagerConfig
 from qiskit.transpiler.target import target_to_backend_properties
+from qiskit.transpiler import CouplingMap
 
 from .level0 import level_0_pass_manager
 from .level1 import level_1_pass_manager
@@ -130,7 +131,7 @@ def generate_preset_pass_manager(
             circuit, transpiler attaches the custom gate definition to the circuit.
             This enables one to flexibly override the low-level instruction
             implementation.
-        coupling_map (CouplingMap): Directed graph represented a coupling
+        coupling_map (CouplingMap or list): Directed graph represented a coupling
             map.
         instruction_durations (InstructionDurations): Dictionary of duration
             (in dt) for each instruction.
@@ -213,6 +214,9 @@ def generate_preset_pass_manager(
             stacklevel=2,
         )
 
+    if coupling_map is not None and not isinstance(coupling_map, CouplingMap):
+        coupling_map = CouplingMap(coupling_map)
+
     if target is not None:
         if coupling_map is None:
             coupling_map = target.build_coupling_map()
diff --git a/releasenotes/notes/fix-input-normalization-of-transpile-initial-layout.yaml b/releasenotes/notes/0.45/fix-input-normalization-of-transpile-initial-layout.yaml
similarity index 100%
rename from releasenotes/notes/fix-input-normalization-of-transpile-initial-layout.yaml
rename to releasenotes/notes/0.45/fix-input-normalization-of-transpile-initial-layout.yaml
diff --git a/releasenotes/notes/preset-passmanager-coupling-map-89e588e4260cb214.yaml b/releasenotes/notes/preset-passmanager-coupling-map-89e588e4260cb214.yaml
new file mode 100644
index 000000000..5830a57d2
--- /dev/null
+++ b/releasenotes/notes/preset-passmanager-coupling-map-89e588e4260cb214.yaml
@@ -0,0 +1,6 @@
+---
+features:
+  - |
+    Enhanced the :func:`.generate_preset_pass_manager` function to allow users to 
+    provide a coupling map as a legacy-format list. Previously, users were required
+    to provide a :class:`.CouplingMap` object.
diff --git a/setup.py b/setup.py
index 3162a1119..97ca604fd 100644
--- a/setup.py
+++ b/setup.py
@@ -57,7 +57,7 @@ csp_requirements = ["python-constraint>=1.4"]
 
 setup(
     name="qiskit-terra",
-    version="0.45.0rc1",
+    version="1.0.0",
     description="Software for developing quantum computing programs",
     long_description=README,
     long_description_content_type="text/markdown",


Test patch:
diff --git a/test/python/circuit/library/test_overlap.py b/test/python/circuit/library/test_overlap.py
index 4ac765d54..a9a5f0ae1 100644
--- a/test/python/circuit/library/test_overlap.py
+++ b/test/python/circuit/library/test_overlap.py
@@ -30,7 +30,7 @@ class TestUnitaryOverlap(QiskitTestCase):
         unitary.assign_parameters(np.random.random(size=unitary.num_parameters), inplace=True)
 
         overlap = UnitaryOverlap(unitary, unitary)
-        self.assertTrue(abs(Statevector.from_instruction(overlap)[0] - 1) < 1e-15)
+        self.assertLess(abs(Statevector.from_instruction(overlap)[0] - 1), 1e-12)
 
     def test_parameterized_identity(self):
         """Test identity is returned"""
@@ -40,7 +40,7 @@ class TestUnitaryOverlap(QiskitTestCase):
         rands = np.random.random(size=unitary.num_parameters)
         double_rands = np.hstack((rands, rands))
         overlap.assign_parameters(double_rands, inplace=True)
-        self.assertTrue(abs(Statevector.from_instruction(overlap)[0] - 1) < 1e-15)
+        self.assertLess(abs(Statevector.from_instruction(overlap)[0] - 1), 1e-12)
 
     def test_two_parameterized_inputs(self):
         """Test two parameterized inputs"""
diff --git a/test/python/transpiler/test_preset_passmanagers.py b/test/python/transpiler/test_preset_passmanagers.py
index c1df58eb0..d37d5c2cb 100644
--- a/test/python/transpiler/test_preset_passmanagers.py
+++ b/test/python/transpiler/test_preset_passmanagers.py
@@ -1272,7 +1272,7 @@ class TestOptimizationOnSize(QiskitTestCase):
 
 
 @ddt
-class TestGeenratePresetPassManagers(QiskitTestCase):
+class TestGeneratePresetPassManagers(QiskitTestCase):
     """Test generate_preset_pass_manager function."""
 
     @data(0, 1, 2, 3)
@@ -1445,6 +1445,37 @@ class TestGeenratePresetPassManagers(QiskitTestCase):
         ]
         self.assertIn("RemoveResetInZeroState", post_translation_pass_list)
 
+    def test_generate_preset_pass_manager_with_list_coupling_map(self):
+        """Test that generate_preset_pass_manager can handle list-based coupling_map."""
+
+        # Define the coupling map as a list
+        coupling_map_list = [[0, 1]]
+        coupling_map_object = CouplingMap(coupling_map_list)
+
+        # Circuit that doesn't fit in the coupling map
+        qc = QuantumCircuit(2)
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.cx(1, 0)
+        qc.measure_all()
+
+        pm_list = generate_preset_pass_manager(
+            optimization_level=0, coupling_map=coupling_map_list, seed_transpiler=42
+        )
+        pm_object = generate_preset_pass_manager(
+            optimization_level=0, coupling_map=coupling_map_object, seed_transpiler=42
+        )
+
+        transpiled_circuit_list = pm_list.run(qc)
+        transpiled_circuit_object = pm_object.run(qc)
+
+        # Check if both are instances of PassManager
+        self.assertIsInstance(pm_list, PassManager)
+        self.assertIsInstance(pm_object, PassManager)
+
+        # Ensure the DAGs from both methods are identical
+        self.assertEqual(transpiled_circuit_list, transpiled_circuit_object)
+
 
 @ddt
 class TestIntegrationControlFlow(QiskitTestCase):