Skip to content

Commit

Permalink
Prepare v0.1.0 (#154)
Browse files Browse the repository at this point in the history
Also minor cleanup
  • Loading branch information
speller26 authored Feb 12, 2024
1 parent 2465096 commit e29cbaf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 8 additions & 10 deletions qiskit_braket_provider/providers/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion qiskit_braket_provider/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Qiskit-Braket provider version."""

__version__ = "0.0.5"
__version__ = "0.1.0"

0 comments on commit e29cbaf

Please sign in to comment.