Skip to main content

qiskit-classroom-converter

Qiskit classroom Converter

Version

0.6.0 (2025-01-01) : The Version has been updated to be compatible with Qiskit 1.3.1 and Python 3.13. 0.5.0 (2024-03-06) : The Version has been updated to be compatible with Qiskit 1.0.0 and Python 3.12.

Documents

https://kmu-quantum-classroom.github.io/qiskit-classroom-converter/qiskit_class_converter.html

Official USER Guide

https://kmu-quantum-classroom.github.io/documents/overview.html

Support convert method

  • quantum circuit to bra-ket notation
  • quantum circuit to matrix
  • matrix to quantum circuit
  • string to bra-ket notation

Options

convert method option
QC_TO_BRA_KET expression{simplify, expand}, print{raw}
QC_TO_MATRIX print{raw}
MATRIX_TO_QC label{str}
STR_TO_BRA_KET print{raw}
from qiskit_class_converter import ConversionService

ConversionService(conversion_type="QC_TO_BRA_KET", option={"expression": "simplify"})

Required data

  • MATRIX_TO_QC
    • User's QuantumCircuit object
from qiskit import QuantumCircuit
from qiskit_class_converter import ConversionService

input_value = [
    [1, 0, 0, 0],
    [0, 0, 0, 1],
    [0, 0, 1, 0],
    [0, 1, 0, 0]
]
sample_converter = ConversionService(conversion_type="MATRIX_TO_QC")
result = sample_converter.convert(input_value=input_value)
# using user's QuantumCircuit object
quantum_circuit = QuantumCircuit(2, 2)
quantum_circuit.append(result, [0, 1])

How to Install

pip install qiskit-classroom-converter

Docker Pull & Run

Alternative installation with docker image.

docker pull ghcr.io/kmu-quantum-classroom/qiskit-classroom-converter
docker run -p 8888:8888 ghcr.io/kmu-quantum-classroom/qiskit-classroom-converter

Dependencies

  • qiskit

Usage

from qiskit import QuantumCircuit
from qiskit_class_converter import ConversionService
# quantum circuit to matrix
quantum_circuit = QuantumCircuit(2, 2)
quantum_circuit.x(0)
quantum_circuit.cx(0, 1)
sample_converter = ConversionService(conversion_type="QC_TO_MATRIX")
result = sample_converter.convert(input_value=quantum_circuit)

code : example.py

How to test the software

python -m unittest -v

or

tox

ARM Platform

Mac ARM chips users may have issues running this package.

We have provided a Dockerfile, which can be used docker-compose.

docker-compose up --build

Acknowledgement

  • 국문 : "본 연구는 2022년 과학기술정보통신부 및 정보통신기획평가원의 SW중심대학사업의 연구결과로 수행되었음"(2022-0-00964)
  • English : "This research was supported by the MIST(Ministry of Science, ICT), Korea, under the National Program for Excellence in SW), supervised by the IITP(Institute of Information & communications Technology Planning & Evaluation) in 2022"(2022-0-00964)

Metadata

Release files for qiskit-classroom-converter 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qiskit-classroom-converter 0.6.0
File Size Uploaded Provenance Actions
qiskit_classroom_converter-0.6.0.tar.gz 12.4 kB Without provenance Details for qiskit_classroom_converter-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qiskit-classroom-converter 0.6.0
File Interpreter ABI Platform Actions
qiskit_classroom_converter-0.6.0-py3-none-any.whl Python 3 none any Details for qiskit_classroom_converter-0.6.0-py3-none-any.whl

Total release size: 29.7 kB

Release files / qiskit_classroom_converter-0.6.0.tar.gz

Download URL qiskit_classroom_converter-0.6.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
279f9dc93841721474cdad1f16ce31470264a11807452fb82763a456d3cd1fee
BLAKE2b-256 checksum
How to use checksums
31035c25197f79b0465f981d3880fcb191ab88730e936f57c40162515174725f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.21

Release files / qiskit_classroom_converter-0.6.0-py3-none-any.whl

Download URL qiskit_classroom_converter-0.6.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1349629f8862369bf70506fc5318ba11aca7b07c3db56c58ee885188733acd37
BLAKE2b-256 checksum
How to use checksums
724114af4c43a485a601c6425975e4da370ed6dba133c20185db40873ba8f988
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.21

Security for qiskit-classroom-converter 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page