Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 478e3d8
  • /
  • RKQC_Testing
  • /
  • rkqc_test.qasmh
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:31981ab9398c7f07a68a6e0b98655b9b46041911
directory badge Iframe embedding
swh:1:dir:743bef50fd9891bceea63dfe3411ff01affef4d2
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
rkqc_test.qasmh
-------QASM Generation Pass:

module assign_value_of_0_to_a_i16_i32_impl ( qbit target , int size  ) {
 	qbit ancilla_zero_zero[1];
	qbit ancilla_zero_garbage[1];
	CNOT ( target , ancilla_zero_garbage[0] );
 	CNOT ( ancilla_zero_garbage[0] , target );
 	CNOT ( ancilla_zero_zero[0] , target );
 }

module assign_value_of_1_to_a_i16_i32_impl ( qbit target , int size  ) {
 	qbit ancilla_one_one[1];
	qbit ancilla_zero_garbage[1];
	CNOT ( target , ancilla_zero_garbage[0] );
 	CNOT ( ancilla_zero_garbage[0] , target );
 	CNOT ( ancilla_one_one[0] , target );
 }

module assign_value_of_b_to_a_i16_i16_i32_impl ( qbit target , qbit control ) {
 	qbit ancilla_zg[1];
	CNOT ( target , ancilla_zg[0] );
 	CNOT ( ancilla_zg[0] , target );
 	CNOT ( control , target );
 }

module a_swap_b_i16_i16_i32_impl ( qbit target0 , qbit target1 ) {
 	CNOT ( target0 , target1 );
 	CNOT ( target1 , target0 );
 	CNOT ( target0 , target1 );
 }

module ToffoliImpl_Q_A_Q ( qbit target , qbit control1 , qbit control2 ) {
 	H ( target );
 	Tdag ( control1 );
 	T ( control2 );
 	T ( target );
 	CNOT ( control2 , control1 );
 	CNOT ( control1 , target );
 	Tdag ( control1 );
 	CNOT ( target , control2 );
 	CNOT ( control1 , control2 );
 	Tdag ( control1 );
 	Tdag ( control2 );
 	T ( target );
 	CNOT ( control1 , target );
 	S ( control1 );
 	CNOT ( target , control2 );
 	CNOT ( control2 , control1 );
 	H ( target );
 }

module a_eq_a_plus_b_i16_i16_i32_impl ( qbit target , qbit control , int size  ) {
 	qbit ancilla_zg[1];
	qbit ancilla_zz[1];
	CNOT ( target , ancilla_zg[0] );
 	CNOT ( control , ancilla_zz[0] );
 	CNOT ( target , control );
 	ToffoliImpl_Q_A_Q ( control , ancilla_zg[0] , target );
 	CNOT ( ancilla_zz[0] , ancilla_zg[0] );
 	CNOT ( ancilla_zz[0] , control );
 	CNOT ( ancilla_zz[0] , control );
 	CNOT ( control , ancilla_zz[0] );
 	CNOT ( ancilla_zz[0] , control );
 	CNOT ( ancilla_zg[0] , target );
 	CNOT ( target , ancilla_zg[0] );
 	CNOT ( ancilla_zg[0] , target );
 }

module reverseBits32 ( qbit* a ) {
 	assign_value_of_0_to_a_i16_i32_impl ( a[0] , 1 );
 	assign_value_of_1_to_a_i16_i32_impl ( a[0] , 1 );
 	assign_value_of_b_to_a_i16_i16_i32_impl ( a[0] , a[1] );
 	a_swap_b_i16_i16_i32_impl ( a[1] , a[0] );
 	a_eq_a_plus_b_i16_i16_i32_impl ( a[1] , a[0] , 1 );
 	assign_value_of_0_to_a_i16_i32_impl ( a[0] , 1 );
 	assign_value_of_1_to_a_i16_i32_impl ( a[1] , 1 );
 	assign_value_of_b_to_a_i16_i16_i32_impl ( a[1] , a[2] );
 	a_swap_b_i16_i16_i32_impl ( a[2] , a[1] );
 	a_eq_a_plus_b_i16_i16_i32_impl ( a[2] , a[1] , 1 );
 }

module main (  ) {
 	qbit h0[32];
	reverseBits32 ( h0 );
 }

--------End of QASM generation

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API