diff --git a/README.md b/README.md index 22ab53b..69920e4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Qiskit-Braket provider +[![Latest Version](https://img.shields.io/pypi/v/qiskit-braket-provider.svg)](https://pypi.python.org/pypi/qiskit-braket-provider) +[![Supported Python Versions](https://img.shields.io/pypi/pyversions/qiskit-braket-provider.svg)](https://pypi.python.org/pypi/qiskit-braket-provider) +[![Build status](https://github.com/qiskit-community/qiskit-braket-provider/actions/workflows/test_latest_versions.yml/badge.svg?branch=main)](https://github.com/qiskit-community/qiskit-braket-provider/actions/workflows/test_latest_versions.yml) + Qiskit-Braket provider to execute Qiskit programs on AWS quantum computing hardware devices through Amazon Braket. ### Table of Contents diff --git a/qiskit_braket_provider/providers/adapter.py b/qiskit_braket_provider/providers/adapter.py index c11a623..8d00e22 100644 --- a/qiskit_braket_provider/providers/adapter.py +++ b/qiskit_braket_provider/providers/adapter.py @@ -436,31 +436,29 @@ def to_braket( "reset operation not supported by qiskit to braket adapter" ) else: - params = _create_free_parameters(operation) if ( isinstance(operation, ControlledGate) and operation.ctrl_state != 2**operation.num_ctrl_qubits - 1 ): raise ValueError("Negative control is not supported") + + # Getting the index from the bit mapping + qubit_indices = [circuit.find_bit(qubit).index for qubit in qubits] + params = _create_free_parameters(operation) if gate_name in _QISKIT_CONTROLLED_GATE_NAMES_TO_BRAKET_GATES: gate = _QISKIT_CONTROLLED_GATE_NAMES_TO_BRAKET_GATES[gate_name](*params) - qubit_indices = [circuit.find_bit(qubit).index for qubit in qubits] gate_qubit_count = gate.qubit_count - target_indices = qubit_indices[-gate_qubit_count:] - instruction = Instruction( - # Getting the index from the bit mapping + braket_circuit += Instruction( operator=gate, - target=target_indices, + target=qubit_indices[-gate_qubit_count:], control=qubit_indices[:-gate_qubit_count], ) - braket_circuit += instruction else: for gate in _GATE_NAME_TO_BRAKET_GATE[gate_name](*params): - instruction = Instruction( + braket_circuit += Instruction( operator=gate, - target=[circuit.find_bit(qubit).index for qubit in qubits], + target=qubit_indices, ) - braket_circuit += instruction if circuit.global_phase > _EPS: braket_circuit.gphase(circuit.global_phase) diff --git a/qiskit_braket_provider/version.py b/qiskit_braket_provider/version.py index c1f97e4..6d576ac 100644 --- a/qiskit_braket_provider/version.py +++ b/qiskit_braket_provider/version.py @@ -1,3 +1,3 @@ """Qiskit-Braket provider version.""" -__version__ = "0.0.5" +__version__ = "0.1.0"