Explicit demonstration of initial state construction in artificial neural networks using NetKet and IBM Q experience platform


Quantum neural networks have gained significant interest in recent times for the representation of many-body states and classical simulation of quantum computation. Here, we discuss the methods to generate specific initial states in the Restricted Boltzmann Machines analogous to those used as the initial states while performing quantum computation in quantum computers such as IBM Q. We validate our approach by applying the Pauli X gate to the single-qubit and two-qubit initial states using NetKet and compare the results to that obtained by performing the same task in the IBM quantum computer. We find that using this approach, the RBM neural networks can represent desired quantum states with high accuracy. Thus, this method is promising to mimic quantum computation classically in neural networks by using specific initial states.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5


  1. 1.

    Jia, Z.-A., Yi, B., Zhai, R., Wu, Y.-C., Guo, G.-C., Guo, G.-P.: Quantum neural network states: a brief review of methods and applications. Adv. Quantum Technol. 2, 1800077 (2019)

    Article  Google Scholar 

  2. 2.

    JDeng, D.-L., Li, X., Sarma, S.D.: Quantum entanglement in neural network states. Phys. Rev. X 7, 021021 (2017)

    Google Scholar 

  3. 3.

    Carleo, G., Troyer, M.: Solving the quantum many-body problem with artificial neural networks. Science 355, 602 (2017)

    ADS  MathSciNet  Article  Google Scholar 

  4. 4.

    Bjarni, J., Bela, B., Carleo, G.: Neural-network states for the classical simulation of quantum computing, arXiv e-prints arXiv:1808.05232v1 (2018)

  5. 5.

    D-Wave System Documentation, Getting Started with the D-Wave System, https://docs.dwavesys.com/docs/latest/doc_getting_started.html

  6. 6.

    Carleo, G., et al.: NetKet: a machine learning toolkit for many-body quantum systems. SoftwareX 10, 100311 (2019)

    Article  Google Scholar 

  7. 7.

    Gardas, B., Rams, M.M., Dziarmaga, J.: Quantum neural networks to simulate many-body quantum systems. Phys. Rev. B 98, 184304 (2018)

    ADS  Article  Google Scholar 

  8. 8.

    Gao, X., Duan, L.-M.: Efficient representation of quantum many-body states with deep neural networks. Nat. Commun. 8, 662 (2017)

    ADS  Article  Google Scholar 

  9. 9.

    IBM Quantum Experience, URL: https://quantum-computing.ibm.com/

  10. 10.

    Rous, N.L., Bengio, Y.: Representational power of restricted Boltzmann machines and deep belief networks. Neural Comput. 20, 1631 (2008)

    MathSciNet  Article  Google Scholar 

  11. 11.

    Freund, Y., Haussler, D.: Unsupervised learning of distributions on binary vectors using two layer networks. In: Advances in Neural Information Processing Systems 4 (NIPS 1991)

Download references


We gratefully acknowledge the discussions on using NetKet with Giuseppe Carleo, Developer Lead and Founder, NetKet. We also acknowledge the support of IBM quantum experience for producing experimental results. To the best of our knowledge, the explicit discussions on preparing initial states similar to that used in the quantum computers has not been published earlier, although significant amount of work has been done in this direction [5, 8, 10, 11]. A.P.D. is supported through KVPY fellowship and S.K. through Inspire fellowship, DST, Govt of India. A.P.D., S.K.S. and S.K. thank IISER Kolkata for providing hospitality during the course of the project. B.K.B. acknowledges the support of IISER-K Institute fellowship.

Author information



Corresponding author

Correspondence to Bikash K. Behera.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary material

Supplementary material

Derivation of the changes in weight parameters to implement the Pauli X gate

Following the notation used in [4], we find that the \(X_l\) gate should flip the spin of the \(l_{th}\) qubit and should not affect the other qubits. Thus, the RBM amplitudes should satisfy

$$\begin{aligned} \langle \mathscr {B}|X_l|\Psi _{W}\rangle = \langle B_1 \cdots \bar{B}_{l} \cdots B_N|\Psi _W\rangle \end{aligned}$$

Since \(\bar{B}_l\)= \(-B\) as a \(+1\) spin should be flipped to \(-1\) spin and vice versa, the equations that should be satisfied are

$$\begin{aligned} -B_l W_{lk} + b_k= & {} B_{l}W'_{lk}+ b'_k \end{aligned}$$
$$\begin{aligned} -B_la_l= & {} B_la'_l +C \end{aligned}$$

whose solution is

  1. 1.


  2. 2.


  3. 3.


  4. 4.


  5. 5.

    All other weight parameters are left unchanged

Preparation on states in IBM Q experience platform

The methods to generate desired initial states (on which the Pauli X gates are applied in tables VII and VIII of the paper) in the IBM quantum computer are represented pictorially in the following figures. The results are obtained by running the experiment using the ibmqx2 backend with 8192 number of slots (Fig. 6).

Fig. 6

Preparation of states in the IBM network: Each qubit starts in the \(|0\rangle \) state. The desired states are prepared by applying various gates to each of the qubits. Here, we have performed a spin z measurement of each of the qubits at the end of the circuit to verify that the qubits are in the desired state

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Dash, A.P., Sahu, S.K., Kar, S. et al. Explicit demonstration of initial state construction in artificial neural networks using NetKet and IBM Q experience platform. Quantum Inf Process 19, 21 (2020). https://doi.org/10.1007/s11128-019-2514-0

Download citation


  • Quantum neural networks
  • Restricted Boltzmann Machines
  • Initial many-body states
  • NetKet
  • IBM quantum experience