Skip to content

unable to simulate for 32 qubit #618

@ketan-more-github

Description

@ketan-more-github

my system spec is
total
Mem: 1.0Ti

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "quest/include/quest.h"

int main() {
  
    initQuESTEnv();
    const int numQubits = 32;

    Qureg qureg = createForcedQureg(numQubits);

    initPlusState(qureg);
    reportQureg(qureg);

    applyHadamard(qureg, 0);

    for (int q = 0; q < numQubits - 1; q++) {
        applyControlledPauliX(qureg ,  q , q+1 );
           
    }

    qreal pb ;
    int measured = applyQubitMeasurementAndGetProb(qureg , numQubits -1 , &pb);

    if (getQuESTEnv().rank == 0)
        printf("Measured value of qubit %d = %d with prob %lf \n", numQubits - 1, measured , pb );

    // cleanup
    destroyQureg(qureg);
    finalizeQuESTEnv();
    return 0;
}

output =>>

Qureg (32 qubit statevector, 4294967296 qcomps, 64 GiB):
    1  |0⟩
    0  |1⟩
    0  |2⟩
    0  |3⟩
    0  |4⟩
    0  |5⟩
    0  |6⟩
    0  |7⟩
    0  |8⟩
    0  |9⟩
    0  |10⟩
    0  |11⟩
    0  |12⟩
    0  |13⟩
    0  |14⟩
    0  |15⟩
    ⋮
    0  |4294967280⟩
    0  |4294967281⟩
    0  |4294967282⟩
    0  |4294967283⟩
    0  |4294967284⟩
    0  |4294967285⟩
    0  |4294967286⟩
    0  |4294967287⟩
    0  |4294967288⟩
    0  |4294967289⟩
    0  |4294967290⟩
    0  |4294967291⟩
    0  |4294967292⟩
    0  |4294967293⟩
    0  |4294967294⟩
    0  |4294967295⟩

Segmentation fault (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions